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,

这样的错误,经过大量的尝试和搜索

看到这个回答,解决了一部分人的问题

https://www.jianshu.com/p/f1436462c825

方式是

Target — Build Settings — VALID_ARCHS 的值删掉

对我没用,因为报出了另一个错

No architectures to compile for (ARCHS=arm64 x86_64, VALID_ARCHS=).

文章里也说了另一个解决办法

VALID_ARCHS 加上 x86_64

对我没用,还是报之前的错误

于是接着找啊找,后来找到了这篇文章

https://developer.apple.com/forums/thread/657913

Excluded Architecture 加上 arm64
Build Active Architecture Only 设置为 NO

设置可行 但打真机包的时候 Excluded Architecture 里的值要去掉
后序有更好的办法再更新

你可能感兴趣的:(building for iOS Simulator, but linking in object file built for iOS,)