我在从 iCloud 保存/检索键/值时遇到问题。我的问题本质上是将密钥保存到 iCloud 并在尝试使用另一台设备读取相同的密钥时检索 nil。
调查这个问题,我在设备控制台上找到了这个。
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: Dec 3 18:11:16 SecTrustEvaluate [leaf CriticalExtensions IssuerCommonName]
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'aps-environment' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'application-identifier' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'aps-environment' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'application-identifier' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'com.apple.developer.ubiquity-container-identifiers' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'aps-environment' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'com.apple.developer.ubiquity-kvstore-identifier' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'application-identifier' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'com.apple.developer.ubiquity-container-identifiers' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'aps-environment' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'com.apple.developer.ubiquity-kvstore-identifier' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'application-identifier' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'keychain-access-groups' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'com.apple.developer.ubiquity-container-identifiers' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'aps-environment' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'com.apple.developer.ubiquity-kvstore-identifier' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'application-identifier' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'com.apple.developer.ubiquity-container-identifiers' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'aps-environment' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'com.apple.developer.ubiquity-kvstore-identifier' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'application-identifier' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'aps-environment' has value not permitted by a provisioning profile
Dec 3 18:11:16 iPhone-4S amfid[641] <Error>: entitlement 'application-identifier' has value not permitted by a provisioning profile
我已删除所有配置文件并重新创建它们,将它们从 Xcode 中删除并重新安装,重新启动设备,但错误仍然存在。
这是我的权利文件内容(该文件由 Xcode 自动创建)
<?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.myCompany.myApp</string>
</array>
<key>com.apple.developer.ubiquity-kvstore-identifier</key>
<string>$(TeamIdentifierPrefix)com.myCompany.myApp</string>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.myCompany.myApp</string>
</array>
</dict>
</plist>
我该如何解决这个问题?