使用CocoaPods时的Xcode 12部署目标警告 [英] Xcode 12 deployment target warnings when using CocoaPods

查看:87
本文介绍了使用CocoaPods时的Xcode 12部署目标警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Xcode 12上收到此警告:

I get this warning on Xcode 12:

iOS Simulator部署目标 IPHONEOS_DEPLOYMENT_TARGET 设置为8.0,但支持的部署目标版本范围是9.0至14.0.99

The iOS Simulator deployment target IPHONEOS_DEPLOYMENT_TARGET is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99

如何支持此版本?

推荐答案

一个简短的解决方案就在这里!只需将下面的代码段复制并粘贴到Podfile的末尾,然后运行 pod install 命令.

A short working solution is here! Just copy and paste the code snippet below at the end of your Podfile and run pod install command.

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

这篇关于使用CocoaPods时的Xcode 12部署目标警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆