問題:
使用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編譯會出現重復的架構版本,去掉重復就可以了,
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/177373.html
標籤:其他
