Xcode 12 部署警告“IPHONEOS_DEPLOYMENT_TARGET”
Posted
技术标签:
【中文标题】Xcode 12 部署警告“IPHONEOS_DEPLOYMENT_TARGET”【英文标题】:Xcode 12 deployment warnings 'IPHONEOS_DEPLOYMENT_TARGET' 【发布时间】:2021-02-18 18:52:41 【问题描述】:我安装了 react-native-maps 并开始收到以下警告:
警告:ios 模拟器部署目标 'IPHONEOS_DEPLOYMENT_TARGET' 设置为 8.0,但支持的范围 部署目标版本是 9.0 到 14.1.99。 (在目标“鳍状肢”中 来自项目“Pods”)警告:iOS 模拟器部署目标 'IPHONEOS_DEPLOYMENT_TARGET' 设置为 7.0,但支持的范围 部署目标版本是 9.0 到 14.1.99。 (在目标 来自项目“Pods”的“Google-Maps-iOS-Utils”)警告:iOS 模拟器部署目标“IPHONEOS_DEPLOYMENT_TARGET”设置为 8.0,但支持的部署目标版本范围是 9.0 到 14.1.99。 (在项目“Pods”的目标“react-native-google-maps”中)
我看到了一些在线建议,如下所示:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['DEBUG_INFORMATION_FORMAT'] = 'dwarf'
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'
end
end
end
但是,我的 podfile 如下所示(这是我安装 react-native 时的样子)
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '10.0'
target 'allocentric' do
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
# React Native Maps dependencies
rn_maps_path = '../node_modules/react-native-maps'
pod 'react-native-google-maps', :path => rn_maps_path
pod 'GoogleMaps'
pod 'Google-Maps-iOS-Utils'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
target 'allocentricTests' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!
post_install do |installer|
flipper_post_install(installer)
end
end
target 'allocentric-tvOS' do
# Pods for allocentric-tvOS
target 'allocentric-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
在“post_install”已经存在之前,我似乎无法运行在线发布的解决方案,我已经尝试删除第一个 post_install 或将上述解决方案放入该 post_install 但都不起作用。
【问题讨论】:
【参考方案1】:评论下面几行
add_flipper_pods!
post_install do |installer|
flipper_post_install(installer)
end
还要在 Pod 文件的末尾添加以下行
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
【讨论】:
【参考方案2】:试试这个添加到 pod 文件中
post_install do |pi|
pi.pods_project.targets.each do |t|
t.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end
end
参考:Range-of-supported
【讨论】:
以上是关于Xcode 12 部署警告“IPHONEOS_DEPLOYMENT_TARGET”的主要内容,如果未能解决你的问题,请参考以下文章
Xcode 中针对 iOS 7 部署目标的 LaunchImage 警告
XCode 5 依赖项警告 - 混淆 iOS 部署目标和架构