Search code examples
ioscloudkit

CKAccountStatusCouldNotDetermine and "Internal Error" (1/2005) when trying to connect to CloudKit


I'm trying to get the very basics of CloudKit working, but am having trouble. When I perform the following,

[[CKContainer defaultContainer] accountStatusWithCompletionHandler:^(CKAccountStatus accountStatus, NSError *error) { }];

I get account status CKAccountStatusCouldNotDetermine and a CKError with a description like

<CKError: "Internal Error" (1/2005)>

I’ve tried these things:

  • Using different iCloud accounts
  • Using different devices
  • Turning iCloud on / off in Settings on each device
  • Completely resetting my device
  • Deleting my provisioning profile and creating new ones, including using a new bundle ID / App ID
  • Turning iCloud on / off in the "Capabilities" tab of my target
  • Using a completely new iCloud container that was never used with iCloud Drive

Xcode thinks everything is fine. I was previously using iCloud Drive (Documents) using a similar set up and things were fine.

Am I missing something totally obvious?


Solution

  • It looks like the issue was using a separate .entitlements file for debug versus production builds, for whatever reason.