Apple M1在模拟器运行项目报错:Xcode 12.3 iOS Simulator

在Apple M1芯片的Mac上,使用Xcode 12.3时遇到了iOS Simulator运行项目错误,问题在于对象文件为iOS架构arm64而非模拟器所需。解决方法包括修改Build Settings,更新Podfile,清理构建文件夹,以及在执行'pod install'时处理可能的错误。
摘要由CSDN通过智能技术生成

Apple M1在模拟器运行项目报错:Xcode 12.3 iOS Simulator

报错内容

  1. …, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64
  2. The linked framework ‘Pods_…framework’ is missing one or more architectures required by this target: arm64.

解决运行模拟器报错

  1. 在 Build Settings中更改
    在这里插入图片描述

  2. 在Podfile中添加代码

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
end
  1. Clean Build Folder
  2. 运行 Pod Install

如果运行“pod install” 时报错

  1. sudo arch -x86_64 gem install ffi
  2. gem install ffi --version 1.13.1 --user-install
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值