Apple M1在模拟器运行项目报错:Xcode 12.3 iOS Simulator
报错内容
- …, 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.
解决运行模拟器报错
-
在 Build Settings中更改
-
在Podfile中添加代码
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
- Clean Build Folder
- 运行 Pod Install
如果运行“pod install” 时报错
sudo arch -x86_64 gem install ffi
gem install ffi --version 1.13.1 --user-install