iOS Xcode 12 模拟器静态库编译报错

升级Xcode 12后,模拟器 Release 模式下编译报错:

ld: ... building for iOS Simulator, but linking in object file built for iOS, file ... for architecture arm64

解决:

Build Settings -> Excluded Architectures -> 添加 arm64

resolve.png

其它

Xcode 12 模拟器编译的静态库 .a or .framework,带上了 arm64 架构,如果创建静态库并合并真机和模拟器的静态库需要去除模拟器编译静态库中的 arm64:

lipo xxx.a or xxx.framework -remove arm64 -output xxx.a or xxx.framework

你可能感兴趣的:(iOS Xcode 12 模拟器静态库编译报错)