Xcode12 编译报错: built for iOS, for architecture arm64...

升级Xcode12后,编译项目时,可能会出现以下错误:

building for iOS Simulator, but linking in object:

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

Embedded binary is not signed with the same certificate:

Embedded binary is not signed with the same certificate as the parent app. Verify the embedded binary target's code sign settings match the parent app's.
Embedded Binary Signing Certificate: XXX 
Parent App Signing Certificate: XXX 

.app" couldn’t be opened because you don’t have permission to view it.:

The file "XXX.app" couldn’t be opened because you don’t have permission to view it.

产生这些报错的根本原因是新版本的Xcode 12更改了编译架构的设置方式

旧版本的Xcode编译架构设置方式: 用Xcode打开项目 -> Project -> PROJECT -> Build Setting ->

  1. 首先在Architectures -> Valid Architectures -> 设置可用的编译架构指令集
  2. 然后在User-Defined -> EXCLUDED_ARCHS -> 设置排除的编译架构指令集

新版Xcode12的编译架构设置方式: 用Xcode打开项目 -> Project -> PROJECT -> Build Setting ->

  1. 首先在Architectures -> Excluded Architectures -> 排除的编译架构指令集
  2. 然后在User-Defined -> VALID_ARCHS -> 设置可用的编译架构指令集

因此,解决上述问题的方案就是在新版的Xcode12中设置:

  1. 在Architectures -> Excluded Architectures -> 设置排除的编译架构指令集为"arm64"。(建议只设置Debug模式,Release模式还是要支持arm64的,否则打包后无法在真机上海安装)
  2. 同时,删除User-Defined中的VALID_ARCHS栏,即可用的编译架构指令集的设置(操作方法:选择PROJECT -> Build Setting ->User-Defined ->选中VALID_ARCHS,直接按Delete键)。



转载于:https://www.jianshu.com/p/7104b1eea05d

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值