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

305,103

Solution 1

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

Solution 2

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

Solution 3

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

Solution 4

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

Solution 5

If anyone came here from react native issue, just delete the /build folder and type react-native run ios

Share:
305,103

Related videos on Youtube

Naresh
Author by

Naresh

iOS - iPhone, iPad app developer. Languages: Swift & Objective C. IoT, Home Automation - product & service based apps. MVVM, MVC. Experience on Wi-Fi, BLE, ZIGBEE, Z-WAVE and IR devices addition and control. Brands worked on Tuya, Philips, LIFX and Remotech etc... I prefer teamwork over working alone.

Updated on July 08, 2022

Comments

  • Naresh
    Naresh almost 2 years

    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

  • Mihai Damian
    Mihai Damian almost 5 years
    The Pods project is auto generated. You shouldn't mess with it.
  • Ahmed El-Bermawy
    Ahmed El-Bermawy almost 5 years
    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.
  • Mihai Damian
    Mihai Damian almost 5 years
    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.
  • gkeenley
    gkeenley almost 5 years
    @MihaiDamian Re "make adjustments from the Podfile via post_install": how would you do that for this scenario?
  • Muhammad
    Muhammad over 4 years
    I have the same warning, but the build is success, So is this important and will make problem on relase ?
  • Ahmed El-Bermawy
    Ahmed El-Bermawy over 4 years
    @Muhammad It have to be answered from the POD developer himself, anyway for me I would not leave any warnings for my project with release
  • Matt Fletcher
    Matt Fletcher over 4 years
    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 answer
  • Erik Escobedo
    Erik Escobedo over 4 years
    Where is this /build folder located, colleague?
  • shogitai
    shogitai over 4 years
    ./project-root/ios/build
  • Fattie
    Fattie about 4 years
    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??
  • George Salamanca
    George Salamanca about 4 years
    What if you already have another post install hook? I'm getting an error indicating multiple post installs is not supported
  • Grigory Entin
    Grigory Entin about 4 years
    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.
  • baskInEminence
    baskInEminence almost 4 years
    This fixed up 100s of xcode warnings for a newly created react native app
  • Ric Santos
    Ric Santos almost 4 years
    This is not longer a suitable solution for me, as the New Build System (Default) is required to generate SwiftUI previews :(
  • Simon Hansen
    Simon Hansen almost 4 years
    @GeorgeSalamanca, you can put into the same post_install block
  • rmp251
    rmp251 almost 4 years
    @Fattie I believe you can just do config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
  • Rami Alloush
    Rami Alloush almost 4 years
    You can select all of them and change at once
  • SmileBot
    SmileBot almost 4 years
    This is not a real solution.
  • StackGU
    StackGU over 3 years
    I inserted the snippet in podfile but it doesn't work
  • FaultyJuggler
    FaultyJuggler over 3 years
    Reverting to old systems isn't a fix
  • Miguel Espeso
    Miguel Espeso over 3 years
    Hi @Tao-Nhan Nguyen, Where should I add the code it shows? Thank you
  • Asaf Pinhassi
    Asaf Pinhassi over 3 years
    Nice! The colored log is very useful
  • LacOniC
    LacOniC over 3 years
    Insert to Podfile in your Ios platform. You should "pod repo update" & "pod install" after insert.
  • Jimbali
    Jimbali over 3 years
    That directory didn't exist for me, but I just ran cd ios && pod install && cd .. and it started working again.
  • Raphael Pinel
    Raphael Pinel over 3 years
    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 podfile
  • Oskar
    Oskar over 3 years
    post_install already exists because of the Flipper setup. You need to combine those into a single post_install
  • vr_driver
    vr_driver over 3 years
    You may want to raise this to 10 or 11. david-smith.org/iosversionstats
  • Tom
    Tom about 3 years
    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?
  • Lane Faison
    Lane Faison about 3 years
    @Tom Add it to the end of your Podfile
  • Sigiria
    Sigiria about 3 years
    Wow, that worked for me after long time! Thank you!
  • Jithin U. Ahmed
    Jithin U. Ahmed almost 3 years
    for me the issue got solved only after changing the platform to 10(+)
  • Sras
    Sras almost 3 years
    fatal error: 'Flutter/Flutter.h' file not found. after updating . i have this
  • edn
    edn over 2 years
    fatal error: 'Flutter/Flutter.h' file not found. after updating as suggested. Did not solve the problem for me..
  • bm888
    bm888 over 2 years
    Here is the updated answer as of late 2021: stackoverflow.com/a/70316588/8094969
  • discodancer
    discodancer over 2 years
    How to make these changes persist?
  • Nathan Tew
    Nathan Tew over 2 years
    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|.
  • Nathan Tew
    Nathan Tew over 2 years
    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|.
  • Franco Altuna
    Franco Altuna over 2 years
    where do you place this?
  • Ankit Maheshwari
    Ankit Maheshwari over 2 years
    This helped me, thanks!
  • edn
    edn over 2 years
    Didn't work for me.
  • Yves Boutellier
    Yves Boutellier over 2 years
    @FrancoAltuna in your Podfile
  • tjpaul
    tjpaul over 2 years
    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?
  • Matthew Rideout
    Matthew Rideout over 2 years
    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.