Cloudkit - "Invalid Bundle Id for Container"

CloudKit - Invalid bundle ID for container

There was a bug causing some associations to be missed. That bug has been fixed and we automatically fixed the container/app associations that were broken during that time.

If for some reason you still need to redo an association you can either use the Capabilities pane in Xcode or use developer.apple.com -> Certificates, Identifiers & Profiles -> App IDs -> pick the ID -> Edit -> Edit under iCloud -> check the box for the container to disassociate, save, then re-associate.

If you're still stuck please email cloudkit[at]apple.com

Getting Invalid bundle ID for container error when using NSPersistentCloudKitContainer

This is how I solve the issue.

I was referring to this answer - CloudKit - "Invalid bundle ID for container"

What I did wrong was

  1. I deleted my app id from https://developer.apple.com/account/resources/identifiers/list

  2. I rerun the app via Xcode, and expecting the app id will be created automatically. But it doesn't. The app id will not be automatically created even if I run the app from Xcode.

    Sample Image


So, what I did right was:

  1. I create a new project with a new app id, and using a new iCloud container id too.

  2. I launch the app for the first time.

  3. From https://developer.apple.com/account/resources/identifiers/list, I click on the app id as shown in the following screenshot.

    Sample Image

    I untick and tick the checkbox for iCloud, click Save button in the top right.

Now, I can observe the data is being saved to iCloud. I have verified by uninstalling the app, installing the app and performing read. There isn't any issue of reading the old data.

Can't access any data from my `CKContainer` from a app extension - CloudKit, Swift

Apple seems to have fixed it on their side!

Thanks for the help anyway :)

CloudKit Permissions Failure

This probably should be a comment, but I don't have enough reputation to comment, so I am putting it here. I think there is a problem with CloudKit right now - see this thread: https://forums.developer.apple.com/thread/49003.

When I search for CloudKit and limit the results to the last 24 hours, the only results that come up are errors...

How do I access iCloud Container data from an app with a different Bundle Identifier?

If you have selected the correct container in the entitlements, then just make sure when you set your CloudKit Container in code from within My App Feedback that you are specifying the correct one:

let container = CKContainer(identifier: "iCloud.com.myDomain.My-App")

and not either of these:

let container = CKContainer(identifier: "iCloud.com.myDomain.My-App-Feedback")
let container = CKContainer.default() //This should work, but might be using the wrong one

You could confirm which container is being selected by printing it to the console when it gets instantiated. Hopefully that helps.

Add the “iCloud containers” entitlement to your App ID

I was having the same problem couple of days ago. Fixed it by doing these steps:

  1. Go to your developer account
  2. Find the App ID you are working on
  3. Click edit.
  4. On the iCloud section select the radio button that says "Include CloudKit support (requires Xcode 6)"
    Sample Image

Worked for me.

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

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.



Related Topics



Leave a reply



Submit