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

1,684 阅读1分钟

转自:原文链接:blog.csdn.net/weixin_4323…

报错内容:

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

解决运行模拟器报错

  1. 在 Build Settings中更改

image.png

  1. 在Podfile中添加代码

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

  3. 运行 Pod Install

如果运行“pod install” 时报错

  • sudo arch -x86_64 gem install ffi

  • gem install ffi --version 1.13.1 --user-install

  • arch -x86_64 pod install