I'm having trouble with iCloud key value store. I currently have a core data synced by iCloud working, but I cannot get K-V Store to work I'm getting:
com.domain.appname has no valid com.apple.developer.ubiquity-kvstore-identifier entitlement
com.domain.appname is the format of my appid, masked for privacy.
This has been around for a while, and I've seen people having this issue and when reinstalling the app the issue is gone, but that won't apply to me. Don't know why.
My entitlements:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.ubiquity-container-identifiers</key>
<array>
<string>$(TeamIdentifierPrefix)com.domain.appname</string>
</array>
<key>com.apple.developer.ubiquity-kvstore-identifier</key>
<string>$(TeamIdentifierPrefix)com.domain.appname</string>
<key>keychain-access-groups</key>
<array>
<string>$(TeamIdentifierPrefix)com.domain.appname</string>
</array>
</dict>
</plist>
If you need anything else just ask, Thank you!
Simply, the error is saying that the com.apple.developer.ubiquity-kvstore-identifier "Key" is missing from the entitlement file which had generated when you enabled iCloud in capabilities. Follow the steps in the screenshot I attached:
or 1. just go to the entitlement file and right click on any row and choose Show Raw Keys/Values
When you hover over Entitlement File row (at the top), a plus button will appear.
Click it and drop down list will appear, choose com.apple.developer.ubiquity-kvstore-identifier and for the value just copy and paste this $(AppIdentifierPrefix)YOUR_BUNDLE_ID
Clean. Build. And Enjoy.