Crashalot
Crashalot

Reputation: 34523

Xcode not creating default container for iCloud and CloudKit: "Add the iCloud containers entitlement to your App ID" fails

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?

Upvotes: 4

Views: 5990

Answers (3)

lbarbosa
lbarbosa

Reputation: 2172

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.

Upvotes: 1

Tenzin
Tenzin

Reputation: 51

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)

Upvotes: 5

webcpu
webcpu

Reputation: 3432

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.

Upvotes: 0

Related Questions