I'm running command in Travis CI:
set -o pipefail && xcodebuild -verbose -workspace APP_NAME.xcworkspace -scheme app_name -sdk iphoneos -configuration Release OBJROOT=$PWD/build SYMROOT=$PWD/build clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty
After compiling all files Travis writes:
▸ Running script 'Rollout.io post-build'
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Rollout.io\ post-build build/APP_NAME.build/Release-iphoneos/APP_NAME.build/Script-FBFA10E57CD7495E8662D829.sh
(1 failure)
Can someone help me with this?
Related
I got the error on CI:
Error: Command failed: cd ./ios && RCT_NO_LAUNCH_PACKAGER=true xcodebuild build build-for-testing
-scheme "MyReactModule-Unit-MyReactModuleTests"
-workspace MyReactModule.xcworkspace
-sdk iphonesimulator
-configuration Debug
-derivedDataPath ./DerivedData/MyReactModule
-quiet
-UseModernBuildSystem=NO ONLY_ACTIVE_ARCH=YES
Additional logs:
xcodebuild: error: Failed to build workspace MyReactModule with scheme MyReactModule-Unit-MyReactModuleTests.
Reason: The scheme 'MyReactModule-Unit-MyReactModuleTests (MyReactModule Workspace)' is not configured for Running.
How to fix it?
Here is my travis.yml file:
osx_image: xcode10.2
language: objective-c
before_install:
- travis_wait 35; cd CalendarKitDemo; pod update
script:
- xcodebuild build -workspace CalendarKitDemo.xcworkspace -scheme "CalendarKitDemo" -sdk iphonesimulator | xcpretty
notifications:
email: false
The problem is that the build is always marked as "succeeded" even if the actual xcodebuild command exited with failure, for example, here:
"failing" job that succeeds
When I remove xcpretty, the job passes failure/success correctly, as with this example job.
How can I both use xcpretty and pass correct values to the Travis CI on the job success / failure?
Your issue is that bash by default uses the exist code from the last command, in xcpretty. So you get the exist code from xcpretty.
You can either go and set the pipefail in your environment (set -o pipefail).
pipefail will cause the script to exit with the first non-zero exit code.
E.g. in your Travis file
script:
- set -o pipefail
- xcodebuild build -workspace CalendarKitDemo.xcworkspace -scheme "CalendarKitDemo" -sdk iphonesimulator | xcpretty
If you want to be more explicit you can also get the exitcode from the first command (xcodebuild) bash exposes the exit codes of a pipeline in the PIPESTATUS array.
So e.g.
- xcodebuild build -workspace CalendarKitDemo.xcworkspace -scheme "CalendarKitDemo" -sdk iphonesimulator | xcpretty && exit ${PIPESTATUS[0]}"
I'm having an issue when I try to carthage update
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -project /Users/Shared/projectLocation/source/Carthage/Checkouts/ActiveLabel.swift/ActiveLabel.xcodeproj -scheme ActiveLabel -configuration Release -derivedDataPath /Users/main/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/ActiveLabel.swift/1.0.1 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/nx/tqnzdw9x5_d73x7tjcmvrv2r0000gn/T/ActiveLabel.swift SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/Shared/projectLocation/source/Carthage/Checkouts/ActiveLabel.swift)
This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/nx/tqnzdw9x5_d73x7tjcmvrv2r0000gn/T/carthage-xcodebuild.LEmVYA.log
I had the same issue, but I resolved.
ActiveLabel.swift was updated on 10/9.
If you use Xcode9, please try to use the tag/0.9.0.
It's written in the below release note.
https://github.com/optonaut/ActiveLabel.swift/releases/tag/1.0.1
I'm having some trouble with my cocoapods running Travis CI. Everything seems to install correctly, but the xcodebuild script fails
$ set -o pipefail && xcodebuild test -workspace Example/UIKitPlus.xcworkspace -scheme UIKitPlus-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c
xcodebuild: error: Failed to build workspace UIKitPlus with scheme UIKitPlus-Example.
Reason: The run destination iPad 2 is not valid for Testing the scheme 'UIKitPlus-Example'.
The command "set -o pipefail && xcodebuild test -workspace Example/UIKitPlus.xcworkspace -scheme UIKitPlus-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c" exited with 70.
https://travis-ci.org/JamieREvans/UIKitPlus/builds/54649639
I'm not sure why this is failing, because I can run my tests on the iPad 2 simulator, using that scheme, without any issues.
Is this a Travis issue or is my Travis script wrong?
I've managed to get it build by adding a destination to the xcodebuild command line, e.g. -destination "platform=iOS Simulator,name=iPhone 6"
I'm using the command line to build all the targets in my project.
I have 3 targets in my project but the build file(.app) is getting created for one target.
Below is script
CONFIG="Ad Hoc"
SDK="iphoneos"
xcodebuild -alltargets -sdk "$SDK" -configuration "$CONFIG"
xcodebuild -project projectname.xcodeproj -alltargets