iOS / Xcode Archive fails with: "Touch" and then "ARCHIVE FAILED", but no other error in the log

Cleaned up log:


+------------------------------------------------------------------------------+
| (3) xcode-archive                                                            |
+------------------------------------------------------------------------------+
| id: xcode-archive                                                            |
| version: 2.0.5                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: go                                                                  |
| time: 2017-02-22T07:45:06-08:00                                              |
+------------------------------------------------------------------------------+
|                                                                              |
e[34mINFOe[0m[07:45:06]  * e[32;1m[OK]e[0m Step dependency (xcode) installed, available. 
e[34mINFOe[0m[07:45:06]  * e[32;1m[OK]e[0m Step dependency (go) installed, available. 

e[34;1mipa export configs:e[0m
- ExportMethod: app-store
- UploadBitcode: yes
- CompileBitcode: yes
- TeamID: REDACTED1
- UseDeprecatedExport: no
- ForceTeamID: REDACTED1
- ForceProvisioningProfileSpecifier: 
- ForceProvisioningProfile: 
- ForceCodeSignIdentity: 
- CustomExportOptionsPlistContent:

e[34;1mxcodebuild configs:e[0m
- OutputTool: xcodebuild
- Workdir: /Users/vagrant/git
- ProjectPath: REDACTED2.xcodeproj
- Scheme: REDACTED2
- Configuration: 
- OutputDir: /Users/vagrant/deploy
- IsCleanBuild: yes
- XcodebuildOptions: 

e[34;1mstep output configs:e[0m
- IsExportXcarchiveZip: yes
- ExportAllDsyms: yes
- ArtifactName: REDACTED2

e[34;1mstep determined configs:e[0m
- xcodebuildVersion: 8.2.1 (8C1002)

e[34;1mCreate the Archive ...e[0m

Forcing Development Team: REDACTED1
[07:45:12] e[32;1m$ xcodebuild "-project" "REDACTED2.xcodeproj" "-scheme" "REDACTED2" "DEVELOPMENT_TEAM=REDACTED1" "clean" "archive" "-archivePath" "/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/__archive__477434250/REDACTED2.xcarchive"e[0m

...

Validate /Users/vagrant/Library/Developer/Xcode/DerivedData/REDACTED2-hbbjhseedfobeohkazdzhfwzwrni/Build/Intermediates/ArchiveIntermediates/REDACTED2/InstallationBuildProductsLocation/Applications/REDACTED2.app
    cd /Users/vagrant/git
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/vagrant/.bitrise/tools:/usr/local/bin:/usr/local/sbin:~/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/go/libexec/bin:/Users/vagrant/go/bin:/Users/vagrant/bitrise/tools/cmd-bridge/bin/osx"
    export PRODUCT_TYPE=com.apple.product-type.application
    builtin-validationUtility /Users/vagrant/Library/Developer/Xcode/DerivedData/REDACTED2-hbbjhseedfobeohkazdzhfwzwrni/Build/Intermediates/ArchiveIntermediates/REDACTED2/InstallationBuildProductsLocation/Applications/REDACTED2.app -validate-for-store

Touch /Users/vagrant/Library/Developer/Xcode/DerivedData/REDACTED2-hbbjhseedfobeohkazdzhfwzwrni/Build/Intermediates/ArchiveIntermediates/REDACTED2/BuildProductsPath/Release-iphoneos/REDACTED2.app.dSYM
    cd /Users/vagrant/git
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/vagrant/.bitrise/tools:/usr/local/bin:/usr/local/sbin:~/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/go/libexec/bin:/Users/vagrant/go/bin:/Users/vagrant/bitrise/tools/cmd-bridge/bin/osx"
    /usr/bin/touch -c /Users/vagrant/Library/Developer/Xcode/DerivedData/REDACTED2-hbbjhseedfobeohkazdzhfwzwrni/Build/Intermediates/ArchiveIntermediates/REDACTED2/BuildProductsPath/Release-iphoneos/REDACTED2.app.dSYM

** ARCHIVE FAILED **

e[31;1mArchive failed, error: exit status 65e[0m
|                                                                              |
+---+---------------------------------------------------------------+----------+
| e[31;1mxe[0m | e[31;1mxcode-archive (exit code: 1)e[0m                                  | 144 sec  |
+---+---------------------------------------------------------------+----------+
| Issue tracker: https://github.com/bitrise-io/steps-xcode-archive/issues      |
| Source: https://github.com/bitrise-io/steps-xcode-archive                    |
+---+---------------------------------------------------------------+----------+

No other error, simply Touch … and then ** ARCHIVE FAILED **.

This issue turned out to be a Build Phase Script in the Xcode project (MG: “I found that archive process might be failing because of non-existing path in Run Script phase. I updated the script, Bitrise CLI succeeds with archiving”), but for some reason Xcode (xcodebuild) did not print any info about this.

VB: so the only thing you changed in the code was a Build Phase Script?
MG: yes
MG: But not really
MG: Previously I tried without the script attached
MG: but then probably provisionings were wrong
MG: now provisionings were correct, but it failed on the script
MG: so in the beginning there was more than 1 failure reason :wink:

Hi, i’m experiencing the exact same problem, but i have no Build Phase Scripts.
id: xcode-archive
version: 2.4.5

ipa export configs:
- ExportMethod: app-store
- UploadBitcode: yes
- CompileBitcode: yes
- TeamID: ***
- UseDeprecatedExport: no
- CustomExportOptionsPlistContent:
xcodebuild configs:
- OutputTool: xcpretty
- Workdir: /Users/vagrant/git
- ProjectPath: ios/eyr.xcworkspace
- Scheme: productName
- Configuration: Release
- OutputDir: /Users/vagrant/deploy
- IsCleanBuild: no
- XcodebuildOptions: 
- ForceTeamID: 
- ForceProvisioningProfileSpecifier: 
- ForceProvisioningProfile: 
- ForceCodeSignIdentity: 
step output configs:
- IsExportXcarchiveZip: no
- ExportAllDsyms: yes
- ArtifactName: eyr
- VerboseLog: yes
step determined configs:
- xcodebuildVersion: 9.2.0 (9C40b)
- xcprettyVersion: 0.2.8

Last lines of the Xcode's build log:
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/vagrant/.bitrise/tools:/usr/local/bin:/usr/local/sbin:~/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin:/usr/local/opt/go/libexec/bin:/Users/vagrant/go/bin:/Users/vagrant/bitrise/tools/cmd-bridge/bin/osx:/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/tools:/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/tools/bin:/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands"
export PRODUCT_TYPE=com.apple.product-type.application
builtin-validationUtility /Users/vagrant/Library/Developer/Xcode/DerivedData/eyr-aovrweneodzgtabgzxwvaqvvrcvp/Build/Intermediates.noindex/ArchiveIntermediates/eyr/InstallationBuildProductsLocation/Applications/eyr.app
Touch /Users/vagrant/Library/Developer/Xcode/DerivedData/eyr-aovrweneodzgtabgzxwvaqvvrcvp/Build/Intermediates.noindex/ArchiveIntermediates/eyr/BuildProductsPath/Release-iphoneos/eyr.app.dSYM
cd /Users/vagrant/git/ios
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/vagrant/.bitrise/tools:/usr/local/bin:/usr/local/sbin:~/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin:/usr/local/opt/go/libexec/bin:/Users/vagrant/go/bin:/Users/vagrant/bitrise/tools/cmd-bridge/bin/osx:/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/tools:/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/tools/bin:/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands"
/usr/bin/touch -c /Users/vagrant/Library/Developer/Xcode/DerivedData/eyr-aovrweneodzgtabgzxwvaqvvrcvp/Build/Intermediates.noindex/ArchiveIntermediates/eyr/BuildProductsPath/Release-iphoneos/eyr.app.dSYM
** ARCHIVE FAILED **
You can find the last couple of lines of Xcode's build log above, but the full log is also available in the raw-xcodebuild-output.log
The log file is stored in $BITRISE_DEPLOY_DIR, and its full path is available in the $BITRISE_XCODE_RAW_RESULT_TEXT_PATH environment variable
(value: /Users/vagrant/deploy/raw-xcodebuild-output.log)
Archive failed, error: exit status 65

@mdrakus please create a new report in #issues:build-issues and we’ll look into it asap! :slight_smile:

1 Like