The iOS Simulator deployment targets is set to 7.0, but the range of supported deployment target version for this platform is 8.0 to 12.1
Asked Answered
R

29

366

I'm getting this below warning message in my Xcode 10.1.

The iOS Simulator deployment targets are set to 7.0, but the range of supported deployment target versions for this platform is 8.0 to 12.1.

My simulator os in 12.1 Xcode 10.1

And I updated my pod file.

enter image description here

My deployment target is 9.0

enter image description here

In my target

enter image description here

Ramachandra answered 15/2, 2019 at 7:5 Comment(3)
Please verify the target in the user-images.githubusercontent.com/5786033/…, Edit : In the frameworkChirrupy
@ Vinaykrishnan, I checked it's 9.0Ramachandra
This guys had the same issue check this could help you, github.com/flutter/flutter/issues/22123 and github.com/CocoaPods/CocoaPods/issues/8069 . Open your Xcode and there is File upper-left next to Apple icon, then open Workspace Settings and change the build system to` Legacy Build System`. And if you haven't tried this yet https://mcmap.net/q/93590/-simulator-is-not-working-with-upgrading-xcode-10Chirrupy
P
529

You can set up your podfile to automatically match the deployment target of all the podfiles to your current project deployment target like this :

post_install do |installer|
 installer.pods_project.targets.each do |target|
  target.build_configurations.each do |config|
   config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
  end
 end
end
Prisage answered 13/10, 2019 at 19:51 Comment(19)
thanks for the great answer! Curious - would it be possible to automate the '9.0' on line four ... so that it just takes the deployment target from your main project??Christean
What if you already have another post install hook? I'm getting an error indicating multiple post installs is not supportedOverprint
This does not seem to work if the minimum deployment target of a pod is already higher than the one enforced. So we'd need to take the original value into account.Kommunarsk
@GeorgeSalamanca, you can put into the same post_install blockWhinny
@Christean I believe you can just do config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'Winstead
I inserted the snippet in podfile but it doesn't workBellyache
Hi @Tao-Nhan Nguyen, Where should I add the code it shows? Thank youSurfing
Insert to Podfile in your Ios platform. You should "pod repo update" & "pod install" after insert.Nadeau
I got this error [!] Invalid 'Podfile' file: [!] Specifying multiple 'post_install' hooks is unsupported. but I don't see any other post_install in my podfileFlorencio
post_install already exists because of the Flipper setup. You need to combine those into a single post_installBrauer
I'm very new to programming and I have no idea where to find that: post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0' end end end can you tell me where to find it?Panelboard
@Panelboard Add it to the end of your PodfileCamporee
fatal error: 'Flutter/Flutter.h' file not found. after updating . i have thisPicrite
fatal error: 'Flutter/Flutter.h' file not found. after updating as suggested. Did not solve the problem for me..Knur
Here is the updated answer as of late 2021: https://mcmap.net/q/93591/-xcode-12-deployment-target-warnings-when-using-cocoapodsCarinthia
if anyone using this solution runs into fatal error: 'Flutter/Flutter.h' file not found, you can try adding this line: flutter_additional_ios_build_settings(target) back under installer.pods_project.targets.each do |target|.Tenuto
where do you place this?Maddis
@FrancoAltuna in your PodfileGenethlialogy
How can I fix this issue in expo-managed app?Browse
H
133

The problem is in your pod files deployment target iOS Version not in your project deployment target iOS Version, so you need to change the deployment iOS version for your pods as well to anything higher than 8.0 to do so open your project workspace and do this:

1- Click on pods.

2- Select each project and target and click on build settings.

3- Under Deployment section change the iOS Deployment Target version to anything more than 8.0 (better to try the same project version).

4- Repeat this for every other project in your pods then run the app.

see the photo for details enter image description here

Halflife answered 21/7, 2019 at 23:27 Comment(10)
The Pods project is auto generated. You shouldn't mess with it.Gervais
I did not mess with the pod (although i found no problem doing so as it's made by human ..) i just changed the version of the iOS that it should be targeted which is acceptable. and this is a better solution than the accepted one which is forcing you to decrease your own project iOS version.Halflife
I'm not saying that the accepted solution is better, just that editing generated files is bad practice. Any file generated by Cocoapods shouldn't be edited manually since it may get overwritten in the future. If you don't like the output you can make adjustments from the Podfile via post_install. These files shouldn't even be committed on your repo.Gervais
@MihaiDamian Re "make adjustments from the Podfile via post_install": how would you do that for this scenario?Ablation
I have the same warning, but the build is success, So is this important and will make problem on relase ?Johathan
@Johathan It have to be answered from the POD developer himself, anyway for me I would not leave any warnings for my project with releaseHalflife
Because changing the podfiles directly doesn't save anything into git, it won't stick and installing a new pod will undo it. One of my major issues was having AppCenter not build properly because of the version issues. Changing it manually won't make any difference, you have to modify the podfile and commit the code up, as per Tao's answerClippard
You can select all of them and change at onceGlauce
How to make these changes persist?Ulphia
This helped me, thanks!Matthus
D
125

Instead of specifying a deployment target in pod post install, you can delete the pod deployment target for each pod, which causes the deployment target to be inherited from the Podfile.

You may need to run pod install for the effect to take place.

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
Divest answered 19/8, 2020 at 14:36 Comment(2)
if anyone using this solution runs into fatal error: 'Flutter/Flutter.h' file not found, you can try adding this line: flutter_additional_ios_build_settings(target) back under installer.pods_project.targets.each do |target|.Tenuto
If you remove the deployment target for the pods, what happens in the scenario where the pod has a higher deployment target than the pods project? For example, what if the app had a deployment target of iOS 12 and the podfile specified iOS 12 so that the pods project had a deployment target of iOS 12, but one of the pods has a deployment target of iOS 13 and we just wiped out that deployment target. Would the app attempt to build the pod and produce an error for the pod that had a deployment target of iOS 13?Lubumbashi
K
67

Iterating over the answer from Tao-Nhan Nguyen, accounting the original value set for every pod, adjusting it only if it's not greater than 8.0... Add the following to the 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
Kommunarsk answered 23/6, 2020 at 2:54 Comment(2)
This fixed up 100s of xcode warnings for a newly created react native appProsperous
This worked for me with a recent flutter upgrade where iOS 10 is the new lowest target for Xcode 13.3. Just changed 8.0 to 10.0.Bimonthly
G
25

We can apply the project deployment target to all pods target. Resolved by adding this code block below to end of your 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

Results log:

fix pods deployment target version warning

Grisons answered 9/10, 2020 at 4:18 Comment(1)
Nice! The colored log is very usefulBrain
O
22

If anyone came here from react native issue, just delete the /build under ./project-root/ios/buildfolder and run this in terminal

react-native run ios
Ontario answered 31/10, 2019 at 19:39 Comment(3)
Where is this /build folder located, colleague?Backdate
./project-root/ios/buildDelfinadelfine
That directory didn't exist for me, but I just ran cd ios && pod install && cd .. and it started working again.Pires
W
10

This solution worked for me for Flutter. open {your_project_root_folder}/ios/Podfile and replace the post_install block with this

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
Wiggle answered 11/7, 2021 at 9:26 Comment(0)
O
9

Try these steps:

  1. Delete your Podfile.lock
  2. Delete your Podfile
  3. Build Project
  4. Add initialization code from firebase
  5. cd /ios
  6. pod install
  7. run Project

This was what worked for me.

Olnek answered 25/6, 2019 at 15:16 Comment(0)
Q
9

if anybody is experiencing is issue while updating to the latest react native, try updating your pod file with

  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
Quinidine answered 17/1, 2021 at 5:23 Comment(0)
M
8

For Swift

If you are using CocoaPods with Xcode 12, then you have probably seen this error:

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.

This is happening because support for iOS 8 has been dropped, but the minimum deployment target for the pod is iOS 8.

Until this is fixed, you can add the following to your 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

This will remove the deployment target from all the pods in your project and allows them to inherit the project/workspace deployment target that has been specified at the top of Podfile.

For React Native

Delete the ./project-root/ios/build folder and type react-native run ios

For Cordova

<preference name="deployment-target" value="8.0" />
Memorandum answered 16/5, 2021 at 8:0 Comment(0)
O
8

All you need to do is just uncomment the following line

# platform :ios, '8.0'

OR

# platform :ios, '9.0'

etc...

and then open iOS folder in the terminal and pass those commands:

% pod repo update
% pod install
Oath answered 29/8, 2021 at 9:3 Comment(2)
Didn't work for me.Knur
Yes! It Worked! Solved all the annoying errors! Thanks.Howzell
M
7

If your are come from react-native and facing this error just do this

  1. Open Podfile(your project > ios>Podfile)
  2. comment flipper functions in podfile as below
#use_flipper!
 #post_install do |installer|
   #flipper_post_install(installer)
 #end
  1. In terminal inside IOS folder enter this command pod install

yep, that is it hope it works to you

Masuria answered 27/12, 2020 at 7:11 Comment(0)
B
7

Simple fix that worked for me in Flutter:

  1. Delete Podfile and Podfile.lock
  2. Run app: This will create a new Podfile. This will probably still fail with an error.
  3. In the new Podfile, uncomment and change the 2nd line to platform :ios, '12.0' (or other min version you want to target)
  4. Run app again, now without errors
Basia answered 16/6, 2021 at 22:1 Comment(1)
Wow, that worked for me after long time! Thank you!Spermicide
R
6

I solved this problem, I changed build system to Legacy Build System from New Build System

In Xcode v10+, select File > Project Settings

In previous Xcode, select File > Workspace Settings

enter image description here

Change Build System to Legacy Build System from New Build System --> Click Done.

enter image description here

Ramachandra answered 15/2, 2019 at 7:31 Comment(3)
This is not longer a suitable solution for me, as the New Build System (Default) is required to generate SwiftUI previews :(Rickierickman
This is not a real solution.Megohm
Reverting to old systems isn't a fixEmbroidery
I
3

Solve this issue by updating the podfile.

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['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0' // you can change this version as per your requirments.
    end
  end
end 

You have to use these line on podfile then your app will run.

Intermigration answered 30/3, 2023 at 2:22 Comment(0)
B
2

For Flutter use this

platform :ios, '10.0'

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
    end
  end
end
Boxthorn answered 20/7, 2021 at 8:38 Comment(1)
for me the issue got solved only after changing the platform to 10(+)Boxthorn
B
1

for cordova developers having this issue

try to set

<preference name="deployment-target" value="8.0" />

in config.xml

Battery answered 19/5, 2020 at 9:30 Comment(1)
You may want to raise this to 10 or 11. david-smith.org/iosversionstatsSpickandspan
F
1

If anyone is getting this problem in 2021 after updating XCode to v13, here's a fix that worked for me:

https://github.com/facebook/react-native/issues/31733#issuecomment-924016466

However, this may not work for all react-native versions, it worked on v0.64 for me.

I used Xcode to create the dummy swift file so I automatically got a request for "Bridging Header"

enter image description here

Hopefully, this would be resolved in a future release.

Farr answered 30/9, 2021 at 8:21 Comment(0)
S
1

Worked for me:

rm ios/Podfile
flutter pub upgrade
flutter pub get
cd ios && pod update
flutter clean && flutter run
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install 
Stepup answered 18/11, 2021 at 0:49 Comment(0)
R
1

most of the above did not work for me. If you dig around you will see that you aren't supposed to run pod install by hand. What worked for me was making sure my physical device was registered with xcode.

  • open xcode workspace for ios. select your device (connected via usb most likely) and click Run. This will prompt you to let xcode register your device.
  • xcode build will most likely fail which is ok - see next steps
  • Quit Xcode!
  • cd ios
  • rm -fR Podfile Podfile.lock Pods
  • in android studio choose the device in question and c
Reginiaregiomontanus answered 8/1, 2022 at 0:30 Comment(0)
C
1

This is how I solved this issue with Firebase 10.1 and Xcode 14.1:

  1. Open Xcode, select Product > Analyze to get all the IPHONEOS_DEPLOYMENT_TARGET warnings. Close Xcode.
  2. Rename DerivedData directory in /Users/YourUserName/Library/Developer/Xcode/ to DerivedData-old
  3. Open Terminal, in your project directory:

pod cache clean --all && pod deintegrate && pod install --repo-update

  1. Open Xcode. Click your Project file. Select "Firebase" in the TARGETS section. Then do this change:

Select iOS deployment target value, select 11.0, then select Other and type 10.0, then enter

  1. All the warning should be gone and a single warning from Xcode should be there: "Update to recommended settings"

enter image description here

  1. Click on Perform Changes button
  2. Restart Xcode

There is a detailed discussion about this at the Firebase project repository.

Cahier answered 12/11, 2022 at 3:19 Comment(0)
P
0

first change the deployment to your choose : like '11.0' and add this step in the last of your pod file

end
post_install do |installer|
 installer.pods_project.targets.each do |target|
  target.build_configurations.each do |config|
   config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
  end
 end
end
Pettifogger answered 6/5, 2021 at 7:21 Comment(0)
A
0

I had the same issue building my React Native project

cocoapods version update worked for me (upgraded from 1.8.4 to 1.11.2)

Aprilaprile answered 29/10, 2021 at 10:35 Comment(0)
S
0

Xcode > Runner > Info deployment Target > IOS Deployment Target: 11 .

open terminal :

pod cache clean --all

.

pod update
Sitsang answered 10/2, 2022 at 20:30 Comment(0)
Z
0

(flutter)In my case I accidentally imported dart.js so if it was working a moment ago and it just stopped on reload or new restart check your imports

Zo answered 18/10, 2022 at 16:13 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Parette
T
0

For flutter this is what I'm using inside <project_root>/ios/Podfile

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
  
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS"] = "armv7"
    config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
  end
end
Tailrace answered 22/11, 2022 at 16:16 Comment(0)
H
0

delete pods folder and podfile.lock,increase deployment target in podfile as well as xcode

Hydride answered 9/2, 2023 at 10:36 Comment(0)
N
-1

I added this below import and I saw this error. If this helps anyone.

import 'dart:js';
Nedrud answered 4/5, 2023 at 17:48 Comment(0)
K
-4

This is a known issue on M1 MacBooks. Run flutter upgrade and that should fix it.

Currently working on M1 Mackbook 12.0.0 Flutter 2.10.0 Dart 2.16.0

Kaufman answered 9/2, 2022 at 15:45 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.