iOS build fails with cloud build using latest Xcode 9

Hi there:
Last week we finaly updated to Unity 2017.2 and everyithing works fine localy and we can build iOS and android as usual. However in iOS we are getting an error on Cloud Build:

2017-11-06 05:42:41.336 xcodebuild[7135:43785] [MT] IDEDistribution: Step failed: <IDEDistributionOptionsStep: 0x7fd412f458f0>: 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}

error: exportArchive: exportOptionsPlist error for key ‘iCloudContainerEnvironment’: expected one of {Development, Production}, but no value was provided

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}

I did some research about it and I think that the issue might be on the way that the export plist is generated:

64662: Generated plist file with the following values:
64663: ▸ -----------------------------------------
64664: ▸ {
64665: ▸ “method”: “ad-hoc”,
64666: ▸ “uploadSymbols”: “false”,
64667: ▸ “provisioningProfiles”: {
64668: ▸ “com.[]": "
64669: ▸ },
64670: ▸ “teamID”: “****”
64671: ▸ }

I read somewhere that this list should include the “iCloudContainerEnvironment” but I cannot be sure as I cannot modify this list. I still can build if I switch back to Xcode 8.3 but that’s not the best of the solutions. If anyone has any suggestions we will be thankful.

We are having the same issue on our Unity 2017.2 jenkins build, specifically the ‘exportOptionsPlist’ step. The file that it generates is missing the specified key.

This only seems to go wrong on automated builds, since everything goes fine when building from the XCode GUI.

Im facing the same issue. Did you manage to fix this?

No, sorry, I’m still having it.

We found a patch by using this code:
projCapability.AddiCloud(true, false, false, true, empty);

instead of this:
projCapability.AddiCloud(true, false, empty);

I’m having the same issue with iCloudContainerEnvironment missing from the exportOptionsPlist with Unity Cloud Build.

I’m using Unity 2017.4.3f1 and unfortunately it doesn’t have an AddiCloud function that accepts five parameters (it only has a function that accepts three parameters).

I’ve solved every other issue related to enabling iCloud with Unity Cloud Build with XCode 9.3, but I’m really stuck on this one.

Anyone else having the same issue, or have more details on a potential fix?

Looks like Unity will be rolling out a fix for this in the next week or so. :slight_smile:

More details: iCloud support in Unity Cloud Build with XCode 9