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?
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.