Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 12 deployment target warnings when using CocoaPods

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?

like image 818
aturan23 Avatar asked Jul 23 '20 14:07

aturan23


People also ask

How do I check my iOS deployment target?

Click the Books target and select the General tab at the top. The General tab contains a section with name Deployment Info. The section contains a dropdown menu and three checkboxes, iPhone, iPad, and Mac. Because I am using Xcode 12, the dropdown menu is currently set to iOS 14.3.

How do I lower deployment target in Xcode?

If you haven't already, change the deployment target to the lowest iOS version you want to support, select the project name then select your app target, choose General and change the version in Deployment Info.

How do I change targets in Xcode?

Add new targets to create separate products in your project, augment an existing app using app extensions, or factor code into a private framework. You can also add new apps, system extensions, test suites, and other types of targets to your project. To add a new target: Choose File > New > Target.


2 Answers

A short working solution is here! Just copy and paste the code snippet below at the end of your Podfile and run the 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 < 12.0               config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'             end          end      end   end 

In this case, 12.0 is the minimum supporting iOS version for AppStore submission. You can change it based your project requirements.

like image 123
Grigor Hakobyan Avatar answered Oct 19 '22 06:10

Grigor Hakobyan


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.

like image 40
Andres Paladines Avatar answered Oct 19 '22 05:10

Andres Paladines