iOS模拟器部署目标设置为7.0,但此平台支持的部署目标版本范围为8.0到12.1

iOS模拟器部署目标设置为7.0,但此平台支持的部署目标版本范围为8.0到12.1,ios,xcode,cocoapods,ios-simulator,google-fabric,Ios,Xcode,Cocoapods,Ios Simulator,Google Fabric,我在Xcode 10.1中收到以下警告消息 iOS模拟器部署目标设置为7.0,但此平台支持的部署目标版本范围为8.0到12.1 我在12.1中的模拟器操作系统 Xcode 10.1 我更新了我的pod文件 我的部署目标是9.0 在我的目标中 我解决了这个问题,我将构建系统从新构建系统 在Xcode v10+中,选择文件>项目设置 在以前的Xcode中,选择文件>工作区设置 将“生成系统”从“新建生成系统”-->更改为“旧生成系统”,单击“完成” 尝试以下步骤: 删除你的Podfile.lo

我在Xcode 10.1中收到以下警告消息

iOS模拟器部署目标设置为7.0,但此平台支持的部署目标版本范围为8.0到12.1

我在12.1中的模拟器操作系统 Xcode 10.1

我更新了我的pod文件

我的部署目标是9.0

在我的目标中


我解决了这个问题,我将构建系统
新构建系统

在Xcode v10+中,选择文件>项目设置

在以前的Xcode中,选择文件>工作区设置

将“生成系统”从“新建生成系统”-->更改为“旧生成系统”,单击“完成”

尝试以下步骤:

  • 删除你的Podfile.lock
  • 删除你的播客文件
  • 建设项目
  • 从firebase添加初始化代码
  • cd/ios
  • pod安装
  • 运行项目

  • 这就是我的工作

    问题出在pod文件部署目标iOS版本中,而不是项目部署目标iOS版本中,因此您需要将pod的部署iOS版本更改为高于8.0的版本,以便打开项目工作区并执行以下操作:

    1-点击豆荚

    2-选择每个项目和目标,然后单击“生成设置”

    3-在部署部分下,将iOS部署目标版本更改为8.0以上的任何版本 (最好尝试相同的项目版本)

    4-在你的pod中的每个其他项目中重复此操作,然后运行应用程序

    详见照片

    您可以设置播客文件,使所有播客文件的部署目标与当前项目部署目标自动匹配,如下所示:

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

    如果有人从react-native问题来到这里,只需删除/build文件夹,并为出现此问题的cordova开发人员键入
    react-native运行ios

    试着设置

    <preference name="deployment-target" value="8.0" />
    
    
    

    在confix.xml中,迭代Tao Nhan Nguyen的答案,计算每个pod的原始值集,仅在不大于8.0时调整它。。。将以下内容添加到pod文件:

    post_install do |installer|
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          if Gem::Version.new('8.0') > Gem::Version.new(config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'])
            config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '8.0'
          end
        end
      end
    end
    

    您可以删除pod部署目标,而不是在pod post install中指定部署目标,这将导致从podfile平台继承部署目标

    您可能需要运行pod install才能产生效果

    platform :ios, '12.0'
    
      post_install do |installer|
        installer.pods_project.targets.each do |target|
          target.build_configurations.each do |config|
            config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
          end
        end
      end
    

    我们可以将项目部署目标应用于所有POD目标。 通过将下面的代码块添加到POD文件的末尾来解决此问题:

    post_install do |installer|
      fix_deployment_target(installer)
    end
    
    def fix_deployment_target(installer)
      return if !installer
      project = installer.pods_project
      project_deployment_target = project.build_configurations.first.build_settings['IPHONEOS_DEPLOYMENT_TARGET']
    
      puts "Make sure all pods deployment target is #{project_deployment_target.green}"
      project.targets.each do |target|
        puts "  #{target.name}".blue
        target.build_configurations.each do |config|
          old_target = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET']
          new_target = project_deployment_target
          next if old_target == new_target
          puts "    #{config.name}: #{old_target.yellow} -> #{new_target.green}"
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = new_target
        end
      end
    end
    
    
    post_install do |installer|
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
        end
      end
    end
    
    结果日志:


    如果您来自
    react native
    并且面临此错误,请执行此操作

  • 打开
    Podfile
    (您的项目>ios>Podfile)
  • podfile中的注释翻转器功能如下
  • 在terminal inside
    IOS
    文件夹中输入此命令
    pod install

  • 是的,就是这样,希望它对您有效

    如果有人在更新到最新的react native时遇到问题,请尝试使用更新您的pod文件

      use_flipper!
      post_install do |installer|
        flipper_post_install(installer)
        installer.pods_project.targets.each do |target|
          target.build_configurations.each do |config|
            config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
          end
        end
       end
    

    首先将部署更改为您自己选择的:如“11.0” 并将此步骤添加到pod文件的最后一个部分

    end
    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'
      end
     end
    end
    

    用于Swift

    如果您在Xcode 12中使用CoCoapod,那么您可能已经看到了以下错误:

    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.
    
    这是因为对iOS 8的支持已被取消,但pod的最低部署目标是iOS 8

    在修复此问题之前,您可以将以下内容添加到播客文件中:

    post_install do |installer|
      fix_deployment_target(installer)
    end
    
    def fix_deployment_target(installer)
      return if !installer
      project = installer.pods_project
      project_deployment_target = project.build_configurations.first.build_settings['IPHONEOS_DEPLOYMENT_TARGET']
    
      puts "Make sure all pods deployment target is #{project_deployment_target.green}"
      project.targets.each do |target|
        puts "  #{target.name}".blue
        target.build_configurations.each do |config|
          old_target = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET']
          new_target = project_deployment_target
          next if old_target == new_target
          puts "    #{config.name}: #{old_target.yellow} -> #{new_target.green}"
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = new_target
        end
      end
    end
    
    
    post_install do |installer|
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
        end
      end
    end
    
    这将从项目中的所有pod中删除部署目标,并允许它们继承Podfile顶部指定的项目/工作区部署目标

    对于React Native

    删除./project root/ios/build文件夹并键入
    react native run ios

    对于科尔多瓦

    <preference name="deployment-target" value="8.0" />
    

    在《颤振》中对我有效的简单修复:

  • 删除
    Podfile
    Podfile.lock
  • 运行应用程序:这将创建一个新的
    Podfile
    。这可能仍然会失败并出现错误
  • 在新的
    Podfile
    中,取消注释并将第2行更改为
    platform:ios,'12.0'
    (或您想要的其他min版本)
  • 再次运行应用程序,现在无错误

  • 请验证中的目标,编辑:在@Vinaykrishnan的框架中,我检查了它是9.0。这家伙有相同的问题检查这可以帮助你,和。打开你的
    Xcode
    ,苹果图标旁边的左上方有
    文件
    ,然后打开
    工作区设置
    ,将构建系统更改为“遗留构建系统”。如果你还没有尝试过,Pods项目是自动生成的。你不应该弄乱它。我没有弄乱pod(虽然我发现这样做没有问题,因为它是由人类制造的…),我只是改变了iOS的版本,它应该成为目标,这是可以接受的。这是一个比公认的解决方案更好的解决方案,它迫使您降低自己的project iOS版本。我并不是说公认的解决方案更好,只是编辑生成的文件是一种不好的做法。Cocoapods生成的任何文件都不应手动编辑,因为将来可能会被覆盖。如果您不喜欢输出,可以通过post_安装从Podfile中进行调整。这些文件甚至不应该在您的repo中提交。@Muhammad它必须由POD开发人员自己回答,无论如何对我来说,我不会给我的发布版项目留下任何警告。您可以选择所有这些文件并立即更改此
    /build
    文件夹位于何处,同事?
    /project root/ios/build
    该目录对我来说不存在,但我刚刚运行了
    cd-ios&&pod-install&&cd..
    ,它又开始工作了。如果