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

创建一个新的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里 选择新创建的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

你可能感兴趣的:(builds fail at xcrun lipo on Xcode 12 beta 3)