iOS*_*iOS 32 xcode ios ios-simulator cocoapods google-fabric
我在Xcode 10.1中收到以下警告消息。
iOS Simulator部署目标设置为7.0,但是此平台支持的部署目标版本范围是8.0至12.1。
我的模拟器OS在12.1 Xcode 10.1中
然后我更新了pod文件。
我的部署目标是9.0
在我的目标
tri*_*ode 74
您可以删除 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
Run Code Online (Sandbox Code Playgroud)
Gri*_*tin 54
迭代来自 Tao-Nhan Nguyen 的答案,计算为每个 pod 设置的原始值,仅在不大于 8.0时对其进行调整......将以下内容添加到 Podfile 中:
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
Run Code Online (Sandbox Code Playgroud)
Ahm*_*awy 23
问题出在Pod文件部署目标iOS版本中,而不是在项目部署目标iOS版本中,因此您需要将Pod的部署iOS版本更改为高于8.0的任何版本,才能打开项目工作区并执行以下操作:
1-单击窗格。
2-选择每个项目和目标,然后单击构建设置。
3-在“开发中”部分,将iOS版本更改为8.0以上的版本(最好尝试使用相同的项目版本)。
4-对吊舱中的所有其他项目重复此操作,然后运行该应用程序。
小智 18
如果有人因为反应本机问题来到这里,只需删除 /build 文件夹并键入 react-native run ios
小智 10
尝试以下步骤:
cd /iospod install这对我有用。
Dr *_*tan 10
这个解决方案对我来说适用于Flutter。打开{your_project_root_folder}/ios/Podfile并用此替换 post_install 块
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
end
end
Run Code Online (Sandbox Code Playgroud)
您可以将podfile设置为自动将所有podfile的部署目标与当前项目部署目标相匹配,如下所示:
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
Run Code Online (Sandbox Code Playgroud)
我们可以将项目部署目标应用于所有 pod 目标。通过将下面的代码块添加到 Podfile 的末尾来解决:
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
Run Code Online (Sandbox Code Playgroud)
结果日志:
小智 8
对于斯威夫特
如果您将 CocoaPods 与 Xcode 12 一起使用,那么您可能已经看到此错误:
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.
Run Code Online (Sandbox Code Playgroud)
发生这种情况是因为对 iOS 8 的支持已被删除,但 pod 的最低部署目标是 iOS 8。
在解决此问题之前,您可以将以下内容添加到 Podfile 中:
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
Run Code Online (Sandbox Code Playgroud)
这将从项目中的所有 pod 中删除部署目标,并允许它们继承在 Podfile 顶部指定的项目/工作区部署目标。
对于反应本机
删除 ./project-root/ios/build 文件夹并输入react-native run ios
对于科尔多瓦
<preference name="deployment-target" value="8.0" />
Run Code Online (Sandbox Code Playgroud)
您所需要做的就是取消注释以下行
# platform :ios, '8.0'
Run Code Online (Sandbox Code Playgroud)
或者
# platform :ios, '9.0'
Run Code Online (Sandbox Code Playgroud)
ETC...
然后在终端中打开 iOS 文件夹并传递这些命令:
% pod repo update
% pod install
Run Code Online (Sandbox Code Playgroud)
我解决了这个问题,将构建系统更改Legacy Build System为New Build System
在Xcode v10 +中,选择“文件”>“项目设置”
在以前的Xcode中,选择“文件”>“工作区设置”
变化构建系统Legacy Build System从New Build System- >单击完成。
小智 7
如果您来自react-native并面临此错误,请执行此操作
Podfile(你的项目> ios>Podfile)#use_flipper!
#post_install do |installer|
#flipper_post_install(installer)
#end
Run Code Online (Sandbox Code Playgroud)
IOS文件夹内的终端中输入此命令pod install是的,希望它对你有用
小智 6
如果有人在更新到最新的 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
Run Code Online (Sandbox Code Playgroud)
在Flutter 中对我有用的简单修复:
Podfile和Podfile.lockPodfile. 这可能仍然会因错误而失败。Podfile,取消注释并将第二行更改为platform :ios, '12.0'(或您想要定位的其他最小版本)| 归档时间: |
|
| 查看次数: |
20786 次 |
| 最近记录: |