When using Team “57AWJ345M2” and setting the project’s Bundle ID to “com.marsgame.fg2”, enabling the iCloud capability and checking Key-Value Storage results in the following error:"Provisioning profile "iOS Team Provisioning Profile: com.marsgame.fg2" doesn't match the entitlements file's value for the com.apple.developer.ubiquity-kvstore-identifier entitlement."
This issue does not occur if we use a different Team or a different Bundle ID.
The project was transferred from another Team to this new Team, and everything worked fine before the transfer.
Additionally, we have tried creating a brand new project, but as long as we use this same Team and this same Bundle ID, the error still occurs when enabling Key-Value Storage.
If you transfer an app that uses iCloud key-value store (NSUbiquitousKeyValueStore), the transferred app should use the orignal store identifier, which by default is the bundle ID prefixed with the orignal team ID, so it still has the access to the existing data.
The orginal store identifier is embedded in the new provisioning profiles you create for the transferred app. What you need is to update your entitlements plist with the full KVS value in your provisioning profile. This is documented in in the “Apps using iCloud” section here.
In your case, is 57AWJ345M2 the new team ID? Using the new team ID as the prefix of the key-value store will lose the access to the orginal store. I believe that's why Xcode gives you the error.
Best,
——
Ziqiao Chen
Worldwide Developer Relations.