There are a lot of detours in solving this problem, but I won’t go into that here.

Solution:

In the Target – > BuildSetting – > Architectures – > Excluded Architectures

  • Click the arrow to expand
  • Click the plus sign on the right to add Any iOS Simulator SDK
  • Add arm64 after the Any iOS Simulator SDK

This way the compiled package will not contain ARM64.

In view of this problem, let me elaborate:

Normally, we need to package the framework to support i386, ARMV7, X86_64, ARM64, etc., because we need to meet the real machine and emulator running. So we normally use the compiled framework to merge, the command line is as follows:

Lipo-create Real machine file path Emulator file path -output Real machine file pathCopy the code

The file path is shown in figure:

However, after Xcode 12 emulator compilation, the generated framework will also include ARM64, Therefore, the architectures have the same arm64 and can’t be in the same fat output file during the consolidation, which can be solved by the initial approach. Add a command to view the contents of the framework:

Lipo-info Framework pathCopy the code

There are some other problems with this. After switching to an M1 Mac, the simulator framework is arm64 and x86_64 is not available. This is where you need another setting, again in Target->BuildSetting, search for the VALID_ARCHS, which describes what architecture you need to include when you build, and add x86_64 later.

Write may not be too organized, the general problem is such a thing, do not understand can leave a message.

Add the default instruction set for Apple mobile devices so far:

  • Armv6: iPhone2G/3G, iPod 1G/2G
  • Armv7: iPhone 3GS/ 4/4S, iPod 3G/4G, iPad 1G/2G/3G, iPad Mini
  • Armv7s: iPhone5, iPhone5c, iPad4
  • Arm64: iPhone5s and later, iPad Air, iPad mini2