Search code examples
iosxcodeicloudarchiveios-provisioning

Xcode Error - Profile doesn't include the com.apple.developer.icloud-container-environment entitlement


We have enabled iCloud capability in our application and enabled below services,

  1. Key-value storage
  2. iCloud Documents

But while trying to export the build through the archive, it's throwing me the below error,

Profile doesn't include the com.apple.developer.icloud-container-environment entitlement.

I have tried to set the com.apple.developer.icloud-container-environment entitlement in Entitlements file also as Production or Development but it did not help me either.

Any clue how to resolve this error?

enter image description hereenter image description hereenter image description here


Solution

  • Here's how I fixed it:

    1. I created an iCloud container on the CloudKit dashboard (in the iCloud section of the Signing & Capabilities in Xcode).

    2. I assigned the newly created container to my app (Developer Website > Certificates, Identifiers & Profiles > Identifiers > my app ID > Capabilities > iCloud > Edit button) and saved the app ID configuration.

    3. Then I created a new App Store provisioning profile for this app ID and used it to manually sign the app when I uploaded it in Xcode.