iOS merge SDK error: have the same architectures (arm64) and can't be in the same fat output file

created at 08-10-2021 views: 181

Question 1: The real machine simulator library cannot be merged, and an error is reported: 

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

Before XCode12:
Compile the simulator static library to support i386 x86_64 two architectures
Compile the real machine static library to support armv7 arm64 two architectures
Use the lipo -create -output command to merge the two libraries into a fat library that supports the four architectures of the emulator and the real machine i386 x86_64 armv7 arm64.

The simulator static library compiled by XCode12 also supports arm64, which leads to the problem that the real machine library and the simulator library cannot be merged.

have the same architectures (arm64) and can't be in the same fat output file

XCode12

Set Build Setting --> Excluded Architectures --> Debug --> add on arm64

Set Build Setting --> Excluded Architectures --> Release --> add arm64

The reason for this is that the simulator library compiled by XCode12 adds support for the architecture arm64.

Just exclude the arm64 of the Simulator.

created at:08-10-2021
edited at: 08-10-2021: