12

I am trying to set up iCloud within my iOS application, I have done the following:

  1. Removed all old certs on mac.
  2. Added iCloud to the App in Dev Console - created new container and added to app
  3. Redone the dev provision and downloaded
  4. Installed the provision
  5. Added the iCloud Entitlement to the app

And this is where is all goes wrong...

I can't get the app running again, the app is building but I am getting an error saying:

The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile.

(0xE8008016).

Any ideas??

UPDATE: I have managed to be able to run the application to get everything programmed and put in place, everything is set up iTunes Connect end, all provisions are valid and sync'd.

Now I am getting errors during validation...

There are 4: Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements that are not supported by iOS. Specifically, key 'com.apple.developer.icloud-container-identifiers' in Payload ------- not supported

Other 3 are similar for other containers!

tshepang
  • 12,111
  • 21
  • 91
  • 136
RichAppz
  • 1,520
  • 2
  • 14
  • 27

5 Answers5

34

Maybe it's a late comment, but I post it here in case that somebody is struggling for the same reason.

I encountered this issue on Xcode8 recently when I was trying to archive. Generally, I enabled iCloud with Xcode in following steps:

  1. Enable iCloud inCapabilities panel in my target by setting the toggle to ON.
  2. Check iCloud under my App Identifier in Member Center turns green automatically, and a iCloud container is created automatically with my App Identifier. (Apple's system does this for us.)
  3. Regenerate my certificate with my App Identifier.
  4. Create a new provisioning profile.
  5. Download and install the new certificate and provisioning profile
  6. Select the new provisioning profile in Signing(Release) section in General panel in my target.

Then I got errors like:

Provisioning profile "iCloud Test" doesn't include the com.apple.developer.ubiquity-container-identifiers, com.apple.developer.icloud-container-identifiers, and com.apple.developer.icloud-services entitlements. Code signing is required for product type 'Application' in SDK 'iOS 10.1' Code signing is required for product type 'Application' in SDK 'iOS 10.1'

At last I found that there were two options in iCloud section under my App Identifier in Member Center. By default, the Compatible with Xcode 5 was selected, but I succeeded by selecting the other option.

enter image description here

Rajesh
  • 10,318
  • 16
  • 44
  • 64
Jonathan Ma
  • 451
  • 4
  • 6
  • Yes you are right, I funnily came across this this morning. Xcode 8 is terrible. – RichAppz Nov 07 '16 at 13:20
  • And I found this [Entitlements Troubleshooting](https://developer.apple.com/library/prerelease/content/technotes/tn2415/_index.html) helpful. – Jonathan Ma Nov 07 '16 at 13:23
9

If you're just adding iCloud to an app for the first time or want to upgrade to use CloudKit after using an older iCloud container:

  1. Go to the Apple Development Center.
  2. Choose Certificates, IDs & Profiles.
  3. Use the dropdown on the top left to switch between iOS/tvOS/watchOS or macOS
  4. Choose App IDs under the Identifiers section.
  5. Choose your app from the list.
  6. Scroll down to iCloud and make sure it is enabled with a green dot.
  7. If it's not enabled or has a yellow dot, click the button at the bottom of the page to Edit and make sure you've checked iCloud service.
  8. You may also need to create a container under the iCloud Containers section then associate it with this app.
Nick
  • 3,172
  • 3
  • 37
  • 49
6

After submitting a report to Apple, it turns out that Apple systems are useless AGAIN!

Ok, so if you are creating a NEW application or you are only just adding iCloud to your application - you will need to make sure the system doesn't pick up or create a iOS8 cloud container!

If it does you need to remove it from your app entitlements file, remove the selected containers in the Apple Developer Console and re-download certs again!

Thanks Apple again!

I got blamed for using pre-released software! I haven't touch Xcode 6 yet!!!

RichAppz
  • 1,520
  • 2
  • 14
  • 27
  • How do you wether you use an iOS8 or iOS7 container? There's no option to toggle between iOS7 and iOS8. Even deleting containers isn't possible. – Roeland Weve Jul 10 '14 at 16:06
  • 1
    Never mind, I found the solution. So you should enable iCloud, but not select any of the containers. – Roeland Weve Jul 10 '14 at 16:26
  • Took me another couple of painful hours trying until I found this answer. Thanks a lot! – Pegolon Jul 14 '14 at 10:22
  • 3
    While this may be late, I'm having a similar issue, but my app had been in the App Store with iOS 7 with iCloud. With Xcode 6, everything became messed up. @zappiDev how do you "delete selected containers?". I can't seem to do that in the Developer Portal and my original container is not there. – amitsbajaj Oct 01 '14 at 11:43
  • You remove the selected containers from you app to stop them pointing to containers you do not want to use – RichAppz Nov 06 '15 at 15:43
  • I’ve been struggling with a similar issue for days. Whether i sign my app manually or automatically, my iCloud container works fine when i install the app directly on my phone. Connected with cable, from Xcode that is. But when i publish the app to iTunes for TestFlight it doesn’t work. As if the provisioning profiles are somehow different. Ive tried everything and revoked and recreated all certs and profiles. Nothing worked. I can see that my dev profile has an iCloud container associated but im guessing when i distribute the app it loses the container. App ID config is correct. Help me! – Nexus Oct 09 '18 at 03:37
  • Are you building and archiving your builds on an automatic cert sign? – RichAppz Oct 09 '18 at 13:40
0

What I did: - leave only com.apple.developer.icloud-services in entitlements file - in Capabilities under iCloud marked key value storage and iCloud Documents (cloud kit EMPTY) - Containers set to specify custom but do not select any of your containers - This will probably give you RED warning sign under steps but leave it as it is DO NOT FIX - Regarding provisioning profile Development and Distribution profiles have to have App ID which has iCloud enabled but NOT linked to any container - In those provisioning profiles set under iCloud OLD version for Xcode 5 etc. not a new one related to iCloud containers

0

I had an error of "Add iCloud Containers to your App ID".

Automatic signing was unable to resolve an issue with target's entitlements.

I don't even use iCloud Containers, only Key-value storage(keychain). I also switched in iCloud section under my App Identifier in Member Center from "Compatible with Xcode 5" to "Include CloudKit support (requires Xcode 6)" problem still remains.

So I fixed it like this:

  1. Enable iCloud Capabilities panel in my target by setting the toggle to ON.
  2. Turn on "Include CloudKit support (requires Xcode 6)" in Member Center (still got same error).
  3. in Xcode in iCloud Capabilities TURN ON CloudKit (even if you don't need it) and then turn OFF.

And then problem solved for me!

Greenonline
  • 1,330
  • 8
  • 23
  • 31
Omega
  • 1