builds fail at xcrun lipo on Xcode 12 beta 3

Issue

使用Xcode編譯項目,遇到error:
fatal error: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: Path1/Release-iphonesimulator/xxxx.framework/xxxx and Path2/Release-iphoneos/xxxx.framework/xxxx have the same architectures (arm64) and can't be in the same fat output file

Reason

Simulator build, using Xcode 12 Beta 3, has 3 architectures - arm64, armx86_64, i386
Device build, using Xcode 12 Beta 3, has 2 architectures - armv7 and arm64

Creating fat library is failed as both have 'arm64' architecture.

似乎是Apple在為使用自家Silicon芯片做準備,目前不確定release后是否仍是這樣;

Solution

創(chuàng)建一個新的xcode12-beta3-solution.xcconfig file:

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))

在選中YourProjectName.xcodeproj,在主面板里選擇Project->Info->Configuration里 選擇新創(chuàng)建的xconfig,即可解決;

Refer:

https://jira.appcelerator.org/browse/TIMOB-28042
https://github.com/Carthage/Carthage/issues/3019

在Command Line Tools中使用時:

https://stackoverflow.com/questions/64022291/ios-14-lipo-error-while-creating-library-for-both-device-and-simulator

Pod lib lint error:

https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-object-file-built-for-ios/63955114#63955114

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

友情鏈接更多精彩內容