2

In the last 3 years. Ive probably spent 2 weeks on this issue, it comes up often if you are cloning and working on other peoples projects but doesn't usually occur on your own.

There are a tonne of answers on the stackoverflow and sometimes you use one answer and it works and other times you have to use another answer. I have solved this issue countless times and never has the same solution worked every time.

this is the error:

'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.4.99.

Where is this error actually coming from, what setting in flutter needs to be changed. I will list all the ways below that have been able to fix it after the error but what I want to know is where is the setting that is causing this problem in the first place.

These are the setting and ways I have used to fix this:

Updating pod file platform:

# Uncomment this line to define a global platform for your project
platform :ios, '13.0'

Updating AppFrameworkInfo.plist:

<key>MinimumOSVersion</key>
<string>13.0</string>

Updating runner deployment target in Xcode:

enter image description here

Updating pods deployment target in Xcode:

enter image description here

Changing the script in the podfile (this works but then causes other errors):

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end

to this

  post_install do |installer|
 installer.pods_project.targets.each do |target|
     flutter_additional_ios_build_settings(target)
     target.build_configurations.each do |config|
        if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 13.0
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
        end
     end
 end

end

Updating the project format in Xcode:

enter image description here

Also:

  • Deleting pod file
  • Deleting podfile.lock
  • Deleting the pods directory
  • Deleting the .symlinks directory
  • Flutter clean
  • Deintegrating pods
  • Pod cache clean -all
  • Pod repo update
  • Pod update
  • Pod install

I wonder if this error even represents the real issue or whether is is something else entirely because if you look at the generated podspec file it lists the ios.deployment target as 9 not 8?. Where is the error coming from and where in Flutter can this be changed?

Thanks

Nicholas Muir
  • 2,897
  • 8
  • 39
  • 89
  • I also faced all these situations in the past. I am saving this question as a quick reference for all the possible solutions. – Suat Özkaya Dec 07 '22 at 17:41
  • Although this is the error some times, I've actually realized that often this is just bad error messaging. The majority of the time it is actually a totally different error which is listed earlier in the logs and for whatever reason it spit out this error after, but by finding the earlier error which is unrelated it clears this error. – Nicholas Muir Jan 11 '23 at 10:41

0 Answers0