Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24395] iOS: subsequent dist builds fail

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-02-13T22:12:34.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.0.2
ComponentsiOS, Tooling
Labelsn/a
ReporterChris Barber
AssigneeChris Barber
Created2017-02-09T19:16:42.000+0000
Updated2017-02-13T22:12:44.000+0000

Description

Build an app for dist-appstore, then without changing anything, build again. The build fails with:
[INFO]  Skipping xcodebuild
[ERROR] An error occurred during build after 5s 103ms
[ERROR] Staging archive directory does not exist
The reason is that after the first build, the staging archive directory is MOVED to ~/Library/Developer/Xcode/Archives and then during the second build, Xcodebuild is NOT invoked and thus the staging directory does not exist. The solution is to copy the staging archive directory to the Xcode archive directory. Also, subsequent dist-adhoc builds fail because the intermediate files are deleted by the Titanium iOS build's differential build system. Note that the generated adhoc IPA file was placed in a directory with the same name as the IPA file. Since both adhoc and appstore builds switched to xcodebuild archive to accommodate Xcode 8.3 having removed PackageApplication, the differential build system is slightly broken and doesn't properly add/remove/update resources in the output archive. To fix this, we must invoke xcodebuild to force the staged assets to be copied into the output archive.

Comments

  1. Chris Barber 2017-02-09

    Titanium SDK master PR: https://github.com/appcelerator/titanium_mobile/pull/8827 Titanium SDK 6_0_X PR: https://github.com/appcelerator/titanium_mobile/pull/8828 To test: App Store Builds 1. Create an Titanium iOS app 2. Add a new image to the Resources directory 3. Perform dist-appstore build 4. Without changing anything, do the exact same dist-appstore build command 5. Note that the build works! 6. Delete the image you added Resources directory 7. Build again using the exact same dist-appstore build command 8. Note that the build works and the file has been removed! Adhoc Builds 1. Create an Titanium iOS app 2. Add a new image to the Resources directory 3. Perform dist-adhoc build 4. Without changing anything, do the exact same dist-adhoc build command 5. Note that the build works and that the IPA is in the <output-dir>/<appname>.ipa file 6. Delete the image you added Resources directory 7. Build again using the exact same dist-adhoc build command 8. Note that the build works and the IPA file no longer contains the image you removed!
  2. Eric Wieber 2017-02-13

    Verified fixed, using: MacOS 10.12 (16A323) Studio 4.8.1.201701192045 Ti SDK 6.0.2 Appc NPM 4.2.8 Appc CLI 6.1.0 Alloy 1.9.5 Xcode 8.3 (8W120l) Performed subsequent builds on Alloy and Classic projects and did not encounter any errors. Then tested differential builds by packaging projects multiple times for Ad Hoc and App Store, with minor, trackable changes. Package contents were as expected on each build. Verified in SDK builds 6.0.2.v20170213102549 and 6.1.0.v20170213134957.

JSON Source