可可豆。 iOS 部署目标 IPHONE_DEPLOYMENT_TARGET

时间:2021-04-15 12:06:55

标签: swift cocoapods

我有很多 CocoaPods 都抛出了这个警告:

iOS 部署目标 'IPHONEOS_DEPLOYMENT_TARGET' 设置为 8.0,但支持的部署目标版本范围为 9.0 到 14.4.99。

无论如何要纠正这些? 转换为 Swift 包是否有帮助,如果有,有没有办法判断 Pod 是否有 Swift 包?

谢谢大家

1 个答案:

答案 0 :(得分:0)

在最后的 pod 文件中,您可以使用它来将每个 pod 的最低操作系统版本设置为特定版本,然后从终端运行 pod install 命令。这将更改部署目标版本。

post_install do |installer|
    installer.pods_project.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
    end
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
        end
    end
end