M1芯片XCode 12编译模拟器Architecture报错问题

这篇博客介绍了在M1芯片Mac上使用XCode12遇到的模拟器架构编译错误,以及如何通过修改pod文件、设置BuildActiveArchitectureOnly为NO和添加VALID_ARCHS来解决这个问题。主要步骤包括:1) 在podfile中添加排除arm64的代码;2) 设置DEBUG模式下BuildActiveArchitectureOnly为NO;3) 在TARGETS中添加VALID_ARCHS支持x86_64。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

M1芯片XCode 12编译模拟器Architecture报错问题

  1. No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=arm64 armv7 armv7s).
  2. Command PhaseScriptExecution failed with a nonzero exit code
  3. xxxx building for iOS Simulator, but linking in object file built for iOS, xxxxx for architecture arm64

1.pod文件添加这个

post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings[“EXCLUDED_ARCHS[SDK=iphonesimulator*]”] = “arm64”
end
end

在这里插入图片描述

2.PROJECT TARGETS pod的PROJECTbuildSetting 里的Build Active Architecture Onlydebug模式给为NO

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

3.TARGETS 里添加自定义VALID_ARCHS

arm64 armv7 armv7s x86_64
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值