真机上可运行,模拟器上不行,并出现以下错误:
in xx/xx/arm64, building for iOS Simulator, but linking in object file built for iOS, file 'xx/xx'
1111111.png或
could not find module for target 'x86_64-apple-ios-simulator'
解决方案
1.在项目的project和target的Build Setting里,搜excluded architectures,然后双击它,会弹出一个弹框,点击加号(如下图)添加arm64
11222.png 111333.png
2、在pod文件里面添加如下代码
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
3.回终端pod install一下
注:之后如需在真机上运行则需把上面第一步和第二步恢复原状,然后pod install一下。
(在上架App Store前也需这样做)
网友评论