繁体   English   中英

iOS 模拟器部署目标“IPHONEOS_DEPLOYMENT_TARGET”设置为 9.0,但支持的部署目标版本范围为 11.0 到 16.2

[英]The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.2

我在 ios 模拟器/设备上构建时遇到问题。

我有这条消息:

The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'DKPhotoGallery' from project 'Pods')

我尝试过了:

  • 在我的 Podfile 中取消注释platform:ios, '11.0'
  • 在我的 podfile 中使用安装后挂钩将每个平台目标设置为 ios 11,如下所示:
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

每次尝试之前,我都会清理所有内容并删除缓存和.lock文件。

我使用 Macbook air M1。

这个问题是几天前突然出现的。 该项目以前工作过。 即使我擦除所有内容并重新克隆项目,它也会导致相同的结果。

您需要做的是:

  1. 在 xcode {Project Folder}/ios/Runner.xcworkspace 中打开您的项目。

在此处输入图像描述

  1. 将 IOS 版本更改为更高版本。

在此处输入图像描述

在此处输入图像描述

注意:在执行 ff 之前尝试将您的 podfile 恢复到其原始状态。 上面的步骤。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM