错误提示: Compiling for iOS 10.0, but module ‘SwiftyJSON’ has a minimum deployment target of iOS 12.0: /Users/nick/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/SwiftyJSON/SwiftyJSON.swiftmodule/arm64-apple-ios.swiftmodule

错误原因:iphone或者iPad设置最低运行的版本是ios10.0,但是使用的第三方库,最低运行是ios12.0,因为第三方库最低要求比iPhone或者iPad高,所以运行报错

解决办法:

查看iphone iPad target的最低ios版本

一直我的iphone iPad设置的target运行ios版本是10.0,查看界面如下,左上角选中自己项目,targets,然后General->Minimun Deployments->iOS 设置了10.0,现在需要把pod里面的第三方库也设置成10.0以下

修改pod里第三方库 可点击Pods,修改 Targets中的所有报错第三方的 iOS Deployment Target

也可以在Pod文件中添加下方代码,重新执行pod install 即可, 下方代码的作用同时也避免了第三方需要验证签名的问题

post_install do |installer|

installer.pods_project.targets.each do |target|

target.build_configurations.each do |config|

config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'

config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""

config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"

config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"

end

end

end

参考链接

评论可见,请评论后查看内容,谢谢!!!评论后请刷新页面。