本文是由Hilax同学提供的完美有效的解决方案,我只是稍作整理。
真机上可运行,模拟器上不行,并出现以下错误:
in xx/xx/arm64, building for iOS Simulator, but linking in object file built for iOS, file 'xx/xx'
或
could not find module for target 'x86_64-apple-ios-simulator'
解决方案
1.在项目的podfile的最后添加以下代码:
arduino
复制代码
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
如图:
2.回终端pod install一下
注:之后如需在真机上运行则需把上面第一步恢复原状,然后pod install一下。
(在上架App Store前也需这样做)