I also solved this issue doing everything I say here, but also quick possibly easier fix iCloud / Entitlement issues with container identifier
With the new XCode and new iOS I figured iCloud integration would be a breeze. Man was I wrong.
The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile.
The minute I check “icloud key-value store” checkbox that error appears durring run. This is with a brand new app, set up properly using new app ID and configured with iCloud support.
Trying different options changes the entitlements file in the following ways:
Each one of which produces diffrent results. Some settings let me launch the app with icloud support supposedly enabled but calling
with a valid identifier, or even with nil is always returning null.
That should not be the case especially if I just set up a new project with icloud support, created my profile, and created a brand new app with the same name.
I had all this working with an older app id and it expired. I have replicated those settings to the “T” and still nothing working completely correctly. The apple documentation seems fairly consistant, although some changes over time, and yet yields no results.
OK, so I created another new project from scratch. Gave it a name and set all the before mentioned steps up in the developer member center. Appid, enable icloud, provisioning profile …
I have found that for app: com.domain.appname
icloud key-value store: abcd1234.com.domain.appname
keychain access groups: abcd1234.com.domain.appname
these are the resuslts int he entitlemtns file, respectivly:
keychain-access-groups: item 0: $(AppIdentifierPrefix).com.bworbyworks.mobilevideoorganizer
I do not get the above error any more, but when I try to access cloud urls i am returned null.