问题一:真机模拟器库无法合并,报错:have the same architectures (arm64) and can't be in the same fat output file
lipo -create Release-iphoneos/xxxSDK.framework/xxxSDK Release-iphonesimulator/xxxSDK.framework/xxxSDK -output xxxSDK fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: Release-iphoneos/xxxSDK.framework/xxxSDK and Release-iphonesimulator/xxxSDK.framework/xxxSDK have the same architectures (arm64) and can't be in the same fat output file
XCode12之前:
编译模拟器静态库支持i386 x86_64两架构
编译真机静态库支持armv7 arm64两架构
使用lipo -create -output命令可以将两个库合并成一个支持模拟器和真机i386 x86_64 armv7 arm64四种架构的胖子库。
XCode12编译的模拟器静态库也支持了arm64,导致出现真机库和模拟器库不能合并的问题。
have the same architectures (arm64) and can't be in the same fat output file
设置Build Setting --> Excluded Architectures --> Debug --> 添加上 arm64
设置Build Setting --> Excluded Architectures --> Release --> 添加上 arm64
出现的原因是XCode12 编译的模拟器库新增支持架构arm64。
将模拟器的arm64给排除出去即可。