问题:
使用Xcode12进行carthage更新,运行以下命令
carthage update --platform iOS --no-use-binaries
*** Building scheme "Alamofire iOS" in Alamofire.xcworkspace
编译失败
Build Failed
Task failed with exit code 1:
/usr/bin/xcrun lipo -create /Users/gaoqinghua/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7209/Alamofire/5.2.2/Build/Intermediates.noindex/ArchiveIntermediates/Alamofire\ iOS/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Alamofire.framework/Alamofire /Users/gaoqinghua/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7209/Alamofire/5.2.2/Build/Products/Release-iphonesimulator/Alamofire.framework/Alamofire -output /Users/gaoqinghua/xx/xx/digital-manager-ios/Carthage/Build/iOS/Alamofire.framework/Alamofire
This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/m7/x46zxcqn07q6r05vgjwr9y0w0000gn/T/carthage-xcodebuild.TzT16X.log
解决方案:
在cartfile同级目录中,用记事本新建个文件,叫tmp.xcconfig
内容是
EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64=arm64 arm64e armv7 armv7s armv6 armv8\
EXCLUDED_ARCHS=$(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT))}
然后执行
export XCODE_XCCONFIG_FILE=$PWD/tmp.xcconfig
carthage update --platform iOS --no-use-binaries --cache-builds
就能继续编译了。
如果依然某个三方库有问题,再次执行update命令即可。
如果依然有问题,去github看看这个库是不是有自身问题。
原因:
是Carthage使用Xcode12编译会出现重复的架构版本,去掉重复就可以了。