[TIMOB-25319] iOS: Fails to package app when using CloudKit
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-09-20T22:08:40.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.3.0 |
Components | iOS |
Labels | n/a |
Reporter | Chris Barber |
Assignee | Chris Barber |
Created | 2017-09-19T16:50:24.000+0000 |
Updated | 2017-09-21T03:33:13.000+0000 |
Description
When packaging an app that uses CloudKit, the IPA export fails:
[DEBUG] Running: /Applications/Xcode-9-gm-seed.app/Contents/Developer/usr/bin/xcodebuild -exportArchive -archivePath "/Users/chris/appc/workspace/testapp3/build/iphone/testapp3.xcarchive" -exportPath "/Users/chris/appc/workspace/testapp3/dist" -exportOptionsPlist "/Users/chris/appc/workspace/testapp3/build/iphone/export_options.plist"
[TRACE] 2017-09-19 11:46:26.873 xcodebuild[38383:2547226] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/wx/j1v32g355xj28rnt9yb_6hfm0000gn/T/testapp3_2017-09-19_11-46-26.872.xcdistributionlogs'.
[TRACE] 2017-09-19 11:46:26.954 xcodebuild[38383:2547226] [MT] IDEDistribution: Step failed: <IDEDistributionOptionsStep: 0x7f99adee0400>: 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}
[TRACE] error: exportArchive: exportOptionsPlist error for key 'iCloudContainerEnvironment': expected one of {Development, Production}, but no value was provided
[TRACE]
[TRACE] 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}
When packaging, the code needs to open the generated entitlements plist file and check if it is using CloudKit, then set the export option.
Ti SDK master PR: https://github.com/appcelerator/titanium_mobile/pull/9446 Ti SDK 6_3_X PR: https://github.com/appcelerator/titanium_mobile/pull/9447 To test, you need to enable CloudKit. I probably did this the hard way, but here goes. 1. Open the Titanium.xcodeproj in the installed SDK and enabled iCloud under Capabilities 2. Add the following
Entitlements.plist
file to the ROOT of your Titanium project directory:3. Add iCloud to your distribution provisioning profile and regenerate/install it 4. Package your app for ad hoc or the app store Note that you need to specify an
\-\-output\-dir
when testing an app store build.FR Passed, using: MacOS 10.12.6 (16G29) Ti SDK 6.3.0.v20170919115035 Appc NPM 4.2.9 Appc CLI 6.2.4 Alloy 1.9.14 Xcode 9.0 (9A235) Able to package projects using CloudKit for adhoc and app store without issue.
Verified in SDK builds 6.3.0.v20170920151245 & 7.0.0.v20170920153129