I have a Travis CI setup on GitHub. I use it to check my commits for iOS app. The problem is, I very often and randomly get an error 65. I have yet to find a solution.
When I restart the job 2-3 times after it has failed it passes in 90% of times.
I previously also had a problem with logs being too verbose for Travis (>4MB) but I added xcpretty
to fix that.
Errors I took from log:
...
Generating 'XYZ.app.dSYM'
❌ error: couldn't remove '/Users/travis/Library/Developer/Xcode/DerivedData/XYZ-aaltcjvmshpmlufpmzdsgbernspl/Build/Products/Debug-iphonesimulator/XYZ.app/SomeName.storyboardc' after command failed: Directory not empty
...
And then at the end of Travis log:
Testing failed:
The file “056-Jj-FAu-view-XmS-Ro-0cO.nib” couldn’t be opened because there is no such file.
error: couldn't remove '/Users/travis/Library/Developer/Xcode/DerivedData/XYZ-aaltcjvmshpmlufpmzdsgbernspl/Build/Products/Debug-iphonesimulator/XYZ.app/SomeName.storyboardc' after command failed: Directory not empty
error: lipo: can't move temporary file: /Users/travis/Library/Developer/Xcode/DerivedData/XYZ-aaltcjvmshpmlufpmzdsgbernspl/Build/Products/Debug-iphonesimulator/XYZ.app.dSYM/Contents/Resources/DWARF/XYZ to file: /Users/travis/Library/Developer/Xcode/DerivedData/XYZ-aaltcjvmshpmlufpmzdsgbernspl/Build/Products/Debug-iphonesimulator/XYZ.app.dSYM/Contents/Resources/DWARF/XYZ.lipo (No such file or directory)
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil emitted errors but did not return a nonzero exit code to indicate failure
** TEST FAILED **
The following build commands failed:
LinkStoryboards
LinkStoryboards
(2 failures)
The command "./scripts/build.sh" exited with 65.
I am using Xcode 8
both in Xcode and Travis settings.
Ah, good question. Occasionally, xcodebuild
steps that are failing during the codesigning step can be addressed using travis_retry
- Travis will retry the step 3 times for any non-zero exit status, which should reduce the need for you to restart it manually. There are some suggested code snippets in the travis-ci/travis-ci
GitHub issue on this as well. Good luck!
If you're running into the error code 65 (from random failures) here's a command you can pipe on the end of your xcodebuild
(assuming you're running tests) command to get back more consistent results:
(XCODEBUILD_COMMAND_HERE) | awk 'BEGIN {success=0} $0 ~ /.* tests, with 0 failures \(.*/ {success=1} {print $0} END {if(success==0){exit 1}}
This looks for tests, with 0 failures (
in your output text, thus using the text output of xcodebuild
instead of the status code of xcodebuild
to determine success.
Note: Keep in mind, if you do something like NSLog(' tests, with 0 failures (');
in your code you make get a false positive, it's very unlikely to happen by accident. You may have to update tests, with 0 failures (
in the awk script between updates of xcodebuild
. But, having consistent results with xcodebuild
is definitely worth that price.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With