carthage踩坑

3,119 阅读1分钟

运行carthage update到一半,报错:

Build Failed Task failed with exit code 65: /usr/bin/xcrun xcodebuild -workspace /Users/maor/myProj/myProj/Carthage/Checkouts/Alamofire/Alamofire.xcworkspace -scheme Alamofire\ watchOS -configuration Release -derivedDataPath /Users/maor/Library/Caches/org.carthage.CarthageKit/DerivedData/Alamofire/3.5.1 -sdk watchos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/6s/5fm277hs03qb526nqykyplk40000gn/T/carthage-xcodebuild.JxFgDC.log 解决方案》 carthage update --platform ios 或者 carthage update --platform ios --no-use-binaries

安装:brew install Carthage

查看版本:Carthage version 创建一个空的Carthage文件:touch Cartfile 保存并关闭cartfile文件,使用cartfile安装框架:Carthage update --platform iOS

针对M1:

安装时候需要添加架构如:
arch -arm64 brew install carthage
平常安装都是brew install xxxxx
修改vim ~/.bash_profile实现平常安装模式
1.用上面命令打开文件
2.添加以下转化
alias brew='arch -arm64 brew'

  1. shift+ :wq 保存后,执行source ~/.bash_profile, 可以愉快的用brew install