I have simple ksh script which runs
carthage update --platform iOS
as a Build pre-action and it started to fail after updating to Xcode 10.
Running the command in Terminal generates Carthage
folder successfully.
To reproduce this issue, quit Xcode and delete DerivedData
and Carthage
folder. Then open Xcode 10 and try to build.
The error I get:
<unknown>:0: error: unable to load standard library for target 'arm64-apple-ios8.0-simulator'
** ARCHIVE FAILED **
The following build commands failed:
CompileSwift normal armv7
CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler
CompileSwift normal arm64
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(4 failures)
Build Failed
Cartfile
points to Alamofire 4.7.3carthage bootstrap
, didn't workenv -i
as advised in open Carthage ticket, didn't workxcodebuild
, found in this answer. This forces you to write your own carthage update
, composed of checkout and build. Only this option worked as Xcode Build pre-action step. The solution was tested.
Non answered thread on Apples forums.
Closed Alamofire ticket
In my case, restarting macOS fixed the problem.
The solution that worked for me was to unset one of the env variables coming from XCode 10 just before executing carthage update:
unset LLVM_TARGET_TRIPLE_SUFFIX
carthage update
I found a way that actually does the trick and its:
write one valid command write after carthage update command
So follow this checklist:
Ensure that your command line tools are configured to use Xcode 10.1. Run the following command from Terminal:
sudo xcode-select -s <path to Xcode 10.1>/Contents/Developer
Ensure that script file has required permissions:
chmod 777 <path-to-script-file>
Write one valid command write after carthage update
command, For example echo succeed
(This actually do the trick):
Tested environment:
Carthage 0.31.2
Xcode 10.1
Working Demo
https://github.com/MojtabaHs/Carthage-WorkingDemo
Note that this is just a hack around the issue explained in question, not all carthage issues.
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