flutter旧项目版本不支持“The iOS Simulato

2021-01-14  本文已影响0人  稻草人12138

具体的报错信息如下:

warning: 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. (in target 'Pods-Runner' from project 'Pods')

Could not build the application for the simulator.
Error launching application on iPhone Xʀ.
image.png

很明显是因为虚拟机版本与项目中支持的版本区间不一致造成的报错,网上大部分解决方案都是在podfile文件中添加:

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 < 8.0
    config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '8.0'
     end
   end
  end
end

经过实测,该方案并不能解决问题。
具体的解决方案,直接在xcode中打开项目,修改具体的版本参数:

首先,打开项目目录下的"iOS"文件夹,双击Runner.xcworkspace文件打开项目

  1. Runner->Targets->build Settings下的iOS Devlopment Target 修改支持提示的范围内的版本,我这里是9.0到14.0.99都可以,我直接修改成了10.0**
    如图


    修改后.png
  2. 为了保证所有的配置都修改完了,还需要进行全局搜索关键字“8.0”查找"漏网之鱼"
    搜索结果.png
    如图,因为我这里已经修改过了,为了演示,我搜索了关键字10.0,只需要逐条修改成你要支持的最低版本即可!
上一篇下一篇

猜你喜欢

热点阅读