Hello,
We’re trying to add GameKit iCloud Game Save support to our iOS project and have stumbled upon some issues when trying to build with our development profile.
We build on UCB using Unity 2019.1.14f and Xcode 11.3.1
(We’ve also tried building using xcode 11.0 with the same error. We cannot try anything lower due to some external plugins requiring xcode 11.+)
The error we’re getting is:
56077: error: exportArchive: exportOptionsPlist error for key 'iCloudContainerEnvironment': expected one of {Development, Production}, but no value was provided
56078: Error Domain=IDEFoundationErrorDomain Code=1 "exportOptionsPlist error for key 'iCloudContainerEnvironment': expected one of {Development, Production}, but no value was provided" UserInfo={NSLocalizedDescription=exportOptionsPlist error for key 'iCloudContainerEnvironment': expected one of {Development, Production}, but no value was provided}
We’re a bit uncertain how we should proceed at this point since we don’t know what else we can do on our end. The strange thing is that everything seems to work fine when building on UCB using our distribution profile.
We can also build the project fine locally, with both development/distribution profiles.
In short, we’ve added all the steps needed to include iCloud support to our project:
- We have enabled iCloud capabilities for our app in the apple developer portal, and updated development and distribution profiles accordingly
- We have added the necessary iCloud capabilities in the app through a post process script, using the ProjectCapabilityManager in the xcode manipulation api:
capabilityManager.AddiCloud(
enableKeyValueStorage: false,
enableiCloudDocument: true,
enablecloudKit: false,
addDefaultContainers: true,
customContainers: null);
At this point we saw that the key com.apple.developer.icloud-container-environment
is never added to the generated entitlements file, so we had to add some custom code that adds this. This didn’t have any effect on the error though. The result of the entitlements file is as followed:
<?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.icloud-container-environment</key>
<string>Development</string>
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
<string>iCloud.$(CFBundleIdentifier)</string>
</array>
<key>com.apple.developer.icloud-services</key>
<array>
<string>CloudDocuments</string>
</array>
<key>com.apple.developer.ubiquity-container-identifiers</key>
<array>
<string>iCloud.$(CFBundleIdentifier)</string>
</array>
</dict>
</plist>
The error seems very similar to the one described here:
The exported plist log from UCB for us looks like this:
56063: Generated plist file with the following values:
56064: ▸ -----------------------------------------
56065: ▸ {
56066: ▸ "method": "development",
56067: ▸ "uploadSymbols": false,
56068: ▸ "provisioningProfiles": {
56069: ▸ "com.company.project": "<redacted>"
56070: ▸ },
56071: ▸ "signingStyle": "manual",
56072: ▸ "teamID": "<redacted>"
56073: ▸ }
56074: ▸ -----------------------------------------
Is this anything that anyone else have stumbled upon, or anything that Unity is aware of? We’re happy to share more information if that’s needed.
Thanks in advance!