iOS building for iOS Simulator, but linking in object file built for iOS XCode12模拟器编译第三方库失败

报错日志如下

building for iOS Simulator, but linking in object file built for iOS

今天升级了XCode12,发现模拟器编译报错:

image.png

是linker链接器报了错:
building for iOS Simulator-arm64 but attempting to link with file built for iOS Simulator-x86_64
原来xcode12模拟器已经用arm架构来编译项目了,而link链接的还是x86架构

临时解决方法:
Target——Build Settings最下面有个VALID_ARCHS,这个VALID_ARCHS在xcode12中已经淘汰了,但有些cocoapod集成进来的三方库还是有这个key,比如这个极光认证:

image.png

在项目Target——Build Settings里找到它

image.png

加一个x86_64

image.png

PS:直接把VALID_ARCHS的value删了也能编译成功,但是我这边运行会报没有权限访问项目.app文件的错

在VALID_ARCHS中加入了x86_64之后我这里就可以正常运行了

你可能感兴趣的:(iOS building for iOS Simulator, but linking in object file built for iOS XCode12模拟器编译第三方库失败)