NSUbiquitousKeyValueStore error: no valid com.apple.developer.ubiquity-kvstore-identifier entitlement

StackOverflow https://stackoverflow.com/questions/8097174

Question

I'm having a problem integrating iCloud with my app.

When I set test out iCloud availability, I receive Success for the function

NSURL *iCloudURL = [fileManager URLForUbiquityContainerIdentifier:@"AppID"];

but right after this, when I attempt to perform:

NSUbiquitousKeyValueStore *iCloudStore = [NSUbiquitousKeyValueStore defaultStore];

I receive the error

NSUbiquitousKeyValueStore error: no valid com.apple.developer.ubiquity-kvstore-identifier entitlement.

Any ideas on how to fix this? My App.Entitlements file is using the default macro'd prefixes, nothing changed from the auto-generated file. iCloud is definitely enabled on the AppID in iTunes Connect.

Thanks.

Was it helpful?

Solution

I had the same problem even though all of my code, settings, entitlements, etc were correct. I fixed it by physically deleting the app from my iPhone, then building in Xcode and running it on my iPhone and it worked. Just wanted to add that in case the other solutions don't work for somebody else out there.

OTHER TIPS

Big warning: if your device is jailbroken, make sure you have uninstalled AppSync. I had two insane days because of that. iCloud (and Game Center) would not work on device with AppSync installed even with correct entitlements and profiles!

I did the follow to get this to work for me (Xcode 4.2.1):

  1. In Xcode, go to your target > Summary > at the bottom, click Enable Entitlements.
  2. In the iOS Provisioning Portal, go to App IDs and enabled iCloud support. (You may not have to do this, but it worked for me.)
  3. Edit your Provisioning Profile to force it to update; then download this profile and open it so it automatically launches in Xcode.
  4. Clean and build your app to your device.

I ran into this problem when attempting to debug a Mac (not iOS) application. The problem turned out to be that I was not signing the debug build, and did not have the deployment phase of the project with "Skip Install" set to "Yes".

Apparently, iCloud will not function properly with an unsigned application.

Add com.apple.developer.ubiquity-kvstore-identifier in your Entitlements with the following value:

$(TeamIdentifierPrefix)$(CFBundleIdentifier)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top