IPHONEOS_DEPLOYMENT_TARGET is set to 8.0 Xcode 12 (Flutter)

30,113

Solution 1

In addition to what Akif said, here's a running list of reasons why this error could be showing up for you:

  1. Set the MinimumOSversion to 9.0 in ios/Flutter/AppFrameworkInfo.plist
  2. In Xcode, ensure that the iOS deployment target at Runner -> Project -> Runner is set to 9.0
  3. In Xcode, ensure that the Deployment Info in Runner -> Targets -> Runner is set to iOS 9.0
  4. Double check that your GoogleService-Info.plist is there and was added via Xcode (not copy/pasted into the directory via Finder for example)
  5. Uncomment the #platform :iOS, '9.0' line in your ios/Podfile

Then, run the following in your terminal to build with a fresh state:

flutter clean \
        && rm ios/Podfile.lock pubspec.lock \
        && rm -rf ios/Pods ios/Runner.xcworkspace \
        && flutter build ios

Solution 2

replace this code of pod file:

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 3

You need to set MinimumOSVersion to 9.0 in ios/Flutter/AppFrameworkInfo.plist. It will look like this:

  <key>MinimumOSVersion</key>
  <string>9.0</string>

Solution 4

Error is self-explanatory that deployment target is missed for application.

This will be added in two places inside Xcode, check the below screenshot where iOS Deployment Target is mention.

1. Runner

enter image description here

2.Pod

enter image description here

Solution 5

If after trying all the solutions above, your code is still not working, especially after an update/upgrade...

Just check out your dart version and also check out for null safety packages...

I just solved mine after battling with errors for days by properly migrating my codes to null safety.

Share:
30,113
Finley Adams
Author by

Finley Adams

Updated on July 09, 2022

Comments

  • Finley Adams
    Finley Adams almost 2 years

    I run my Flutter project in Android Studio, pod installation goes well but Xcode build fails at the end every time like 20/30 steps first of complete the whole build. The weird fact is that Android Studio says :

    Command PhaseScriptExecution failed with a nonzero exit code
        note: Using new build system
        note: Building targets in parallel
        note: Planning build
        note: Constructing build description
    warning: 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.2.99. (in target 'GoogleDataTransport' from project 'Pods')
        warning: 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.2.99. (in target 'path_provider' from project 'Pods')
        warning: 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.2.99. (in target 'nanopb' from project 'Pods')
        warning: 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.2.99. (in target 'BoringSSL-GRPC' from project 'Pods')
        warning: 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.2.99. (in target 'AppAuth' from project 'Pods')
        warning: 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.2.99. (in target 'GoogleUtilities' from project 'Pods')
        warning: 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.2.99. (in target 'GTMAppAuth' from project 'Pods')
        warning: 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.2.99. (in target 'gRPC-C++' from project 'Pods')
        warning: 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.2.99. (in target 'google_sign_in' from project 'Pods')
        warning: 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.2.99. (in target 'FirebaseCoreDiagnostics' from project 'Pods')
        warning: 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.2.99. (in target 'FirebaseCore' from project 'Pods')
        warning: 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.2.99. (in target 'FirebaseFirestore' from project 'Pods')
        warning: 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.2.99. (in target 'FirebaseAuth' from project 'Pods')
        warning: 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.2.99. (in target 'firebase_core' from project 'Pods')
        warning: 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.2.99. (in target 'firebase_auth' from project 'Pods')
        warning: 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.2.99. (in target 'cloud_firestore' from project 'Pods')
        warning: 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.2.99. (in target 'gRPC-Core' from project 'Pods')
        warning: 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.2.99. (in target 'Firebase' from project 'Pods')
        warning: 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.2.99. (in target 'gRPC-C++-gRPCCertificates-Cpp' from project 'Pods')
        warning: 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.2.99. (in target 'GoogleSignIn' from project 'Pods')
        warning: 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.2.99. (in target 'leveldb-library' from project 'Pods')
        warning: 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.2.99. (in target 'Flutter' from project 'Pods')
        warning: 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.2.99. (in target 'abseil' from project 'Pods')
    

    But when I open the workspace with Xcode I see that my target in Runner has iOS deployment target 14.0 so I don't understand, it should be set to 14 but actually it's 8. Flutter generated Podfile, Podfile.lock and Pods through flutter run I prefer to let Flutter handle Pod generation and installation without using pod init, pod install or editing Podfile.

  • Finley Adams
    Finley Adams over 3 years
    I don't have this folder. My path is "ios/Flutter/" and inside Flutter I have "App.framework, flutter_export_enviroment.sh, Flutter.framework, Flutter.podspec, Generated.xconfig".But inside Flutter.framework there's a "Info.plist". And here yes there's the voice "MinimumiOSVersion" and I set it to 14, is it correct?
  • Akif
    Akif over 3 years
    No, set it to 9.
  • Finley Adams
    Finley Adams over 3 years
    There isn't "Deployment info" but "Deployment target" instead, and both are set to 14, is it the same?
  • Finley Adams
    Finley Adams over 3 years
    Ok I trust you but why? Isn't better to set it for newer versions?
  • Akif
    Akif over 3 years
    No. You are defining the minimum OS version. And It should be at least 9.0 for iOS. And the newer versions like 10, 11, 12, 13, 14 can use your app. But if you set it to 14, then only iOS14 iPhones will use your app.
  • Finley Adams
    Finley Adams over 3 years
    Oh you're right thanks! Ok I did it but when the run ends that line has been changed back to 8.0 and I have the same error.
  • Finley Adams
    Finley Adams over 3 years
    I did all these stuffs but when the run ends I have "MinimumiOSVersion" back to 8.0...And the same error again
  • Akif
    Akif over 3 years
    Follow the steps of @thefoxrocks's answer.
  • Finley Adams
    Finley Adams over 3 years
    I did it but I have the same error, maybe Xcode version 12 isn't a good choice?
  • Finley Adams
    Finley Adams over 3 years
  • Akif
    Akif over 3 years
    I'm in the chat room.
  • Akif
    Akif over 3 years
    remove # and uncomment that line in the podfile. # platform :ios, '9.0'
  • Finley Adams
    Finley Adams over 3 years
    Did it but still the same, nothing changed
  • Akif
    Akif over 3 years
    I'm in the chat room again.
  • Akif
    Akif over 3 years
    you can try to add that line in ios/Runner/info.plist: <key>MinimumOSVersion</key> <string>9.0</string>
  • thefoxrocks
    thefoxrocks over 3 years
    @FinleyAdams Make sure you're setting the right AppFrameworkInfo.plist that's in ios/Flutter. I know there's another AppFrameworkInfo that will override at build time which might be the one you're using.
  • genericUser
    genericUser over 3 years
    "flutter build iOS" should be lowercase "flutter build ios"
  • waletoye
    waletoye about 3 years
    @Akif can you help out. having same exact issues. flutter
  • Akif
    Akif about 3 years
    Define the issue in a new question!
  • PAYRE Quentin
    PAYRE Quentin about 3 years
    Infortunetly I got this : The Xcode project defines schemes: dev, prod, staging You must specify a --flavor option to select one of the available schemes.. I pass the entire day figuring out how to solve this issue.. migrate from 2.0.3 to 2.0.5
  • Kishan Dhankecha
    Kishan Dhankecha almost 3 years
    @FinleyAdams Have you got the solution??
  • Alexa289
    Alexa289 over 2 years
    what do you mean with check out dart version? and how to solve the issue? could you please elaborate more?
  • LearningPath
    LearningPath over 2 years
    This is non quality to have to specify ios platform in various location...there should be a single entry point...I feel ios coding environment is quite a bugging mess with a lovely interface
  • goldensoju
    goldensoju almost 2 years
    for flutter apps, flutter_additional_ios_build_settings(target) should be added after line installer.pods_project.targets.each do |target|.