36
votes

I get this warning on 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.0.99

How to support this version?

5
If this is for an app to be distributed, you should consider that iOS 8 has almost no users according to various statistics sites.Phillip Mills
To emphasises @PhillipMills' point, all devices supported by iOS 8 are also supported by iOS 9. It's extremely rare that people have iOS devices on which they don't install OS updates but for which they do actively download or update apps.Tommy

5 Answers

39
votes

A short working solution is here! Just copy and paste the code snippet below at the end of your Podfile and run pod install command.

    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
18
votes

This is a problem with the target at your cocoa pods. To me, the answer was to put this code at the end of your pod file:

 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

It resolved all my problems, compiling and archiving the project.

Another way is just to change the IPHONEOS_DEPLOYMENT_TARGETin the pods project like described in this image:

enter image description here Best regards.

6
votes

Update: To fix this issue you just need to update the Deployment Target to 9.0. This can be updated by opening the .xcworkspace file, choose the Pods.xcodeproj on Xcode, and updating the iOS Deployment Target to 9.0 or later as depicted in the below image.

enter image description here

Another easy fix is to add the following to your Podfile and running pod install on terminal in the directory.

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

Previous: You can't provide support for iOS 8.0 on Xcode 12 unless you import the support files. To provide support by default you would have to use Xcode 11. It would be better to check for the number of users that use your app on iOS 8 and update the minimum supported version to iOS 9 or higher.

2
votes

This is happening because support for iOS 8 has been dropped in Xcode 12 but the minimum deployment target for the offending pod is still iOS 8. This is documented in the Xcode 12 release notes:

Deprecations

  • Xcode now supports debugging apps and running tests on iOS devices running iOS 9.0 and above.

Workaround. You can append the following to your Podfile as a workaround for now (and then run pod install as usual):

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.delete 'IPHONEOS_DEPLOYMENT_TARGET'
      end
    end
  end
end

This will remove the deployment target settings from all pods using iOS 8 or below, allowing them to simply inherit the project deployment target that you have specified at the top of your Podfile. For instance:

platform :ios, '10.0'
0
votes

I also needed to add

s.platform = :ios, "9.0"

to my .podspec file for this to work, as well as the post_install script from any of the above (or below) answers.

Note: s.platform was

s.platform = :ios