Xcode 12: building for iOS Simulator, but linking in object file built fo... for architecture arm64

升级Xcode12后

报错:

"building for iOS Simulator, but linking in object file built for iOS, file '/Users/.../Pods/AlipaySDK-iOS/AlipaySDK.framework/AlipaySDK' for architecture arm64

clang: error: linker command failed with exit code 1 (use -v to see invocation)"

翻译:

“正在构建iOS模拟器,但在为iOS构建的对象文件中链接,文件'/Users/../Pods/AlipaySDK iOS/AlipaySDK.framework/AlipaySDK'用于建筑arm64

clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

原因:

这是 32位应用的问题,苹果已经废除了。

解决:

Build Setting 搜索 VALID_ARCHS 将 里面的值 都去掉

如果搜索不到VALID_ARCHS,可以搜索:Excluded, 在里面添加arm64 ,跑真机的时候去掉即可

如果报错:

No architectures to compile for (ARCHS=arm64 x86_64, VALID_ARCHS=).
则在VALID_ARCHS里面添加:(其实就是arm64引起的问题,删除就OK了;然后可以添加x86_64)

armv7 armv7s arm64e x86_64
如果还是报错:

Excluded Architecture 加上 arm64

Build Active Architecture Only 设置为 NO

(注意:打真机包的时候 Excluded Architecture 里的值要去掉)

//----注意-----

1、如果重启后还是不行,

点击“前往”--"前往文件夹", 输入~/Library/Developer/Xcode/DerivedData 清楚里面所有项

2、Xcode12 用不了代码注入工具 injectioniii,在"Other Linker Flags"里面添加"-Xlinker -interposable" 会报错

can't find ordinal for imported symbol for architecture x86_64

你可能感兴趣的:(Xcode 12: building for iOS Simulator, but linking in object file built fo... for architecture arm64)