4
votes

The Apple docs here say Xcode automatically generates a default container when you enable CloudKit and iCloud. Other posts on SO say the same thing.

However, Xcode fails to generate a default container after enabling iCloud and CloudKit.

In the Capabilities tab, in the iCloud section, there is an error for the step Add the "iCloud containers" entitlement to your App ID. The other steps show a checkmark.

Clicking Fix issue does not, in fact, fix the issue.

The developer portal shows iCloud has been enabled for this app and provisioning profile, which also seems supported by the fact that the first step (i.e., Add the "iCloud" entitlements to your App ID) is checked.

Do you have to manually create the container, or how can you get Xcode to generate the container automatically?

3
I suspect this is not an issue with the app, but your developers signature. Login to the developers portal and check that there isn't some changes or something that you have yet to agree too.user3069232
An update as of 2020: This behaviour seems intentional on iOS 13. Here is the related answer.Ert

3 Answers

1
votes

I just went through this and fixed it by generating a new development provisioning profile and downloading it using Xcode (Preferences -> Select Account -> View details -> Download)

When the App ID changes, the existing development provisioning profile is invalidated.

Once you create a new development provisioning profile and import it, the error should disappear.

4
votes

In the identifiers section, there's an option to add manually a container, when you change the selector from "App ID" to "iCloud containers"

Select iCloud container

  • Add manually the container
  • Select this container in App ID capabilities
  • re-generate the provisioning profile
  • refresh Xcode (get in preferences/Accounts/Download manual Profiles)
0
votes

It seems that there is no way to create iCloud container sometimes, what you can do is to change the App ID to create iCloud container.

Select your app target -> General:

  1. Go to Identify -> Bundle Identifier, change the App ID

  2. Go to Signing -> Automatically manage signing, untick and tick it to regenerate provisioning profiles if it's necessary.

  3. Go to Capabilities -> iCloud, Select 'Specify custom containers' and choose the container for your app.