The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, in Flutter How can I change the minimum IOS Deploying Target

I changed everything to 9.0 in the project but I'm having the same error in a lot of pods.

I tried doing a lot of different things but nothing worked. Does anyone know how can I fix this?

warning: The iOS 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. (in target 'gRPC-C++-gRPCCertificates-Cpp' from project 'Pods')
warning: The iOS 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. (in target 'GoogleAppMeasurement' from project 'Pods')
warning: The iOS 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. (in target 'FirebaseAuth' from project 'Pods')
warning: The iOS 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. (in target 'GoogleUtilities' from project 'Pods')
warning: The iOS 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. (in target 'vibration' from project 'Pods')
warning: The iOS 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. (in target 'nanopb' from project 'Pods')
warning: The iOS 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. (in target 'BoringSSL-GRPC' from project 'Pods')
warning: The iOS 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. (in target 'gRPC-Core' from project 'Pods')
warning: The iOS 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. (in target 'gRPC-C++' from project 'Pods')

Encountered error while building for device.


Solution 1:

What worked for me is a combination of @raffaelli-l-c and @arhan-reddy-busam answer.

Ensure that you do the following:

  • Set MinimumOSVersion to 9.0 in ios/Flutter/AppFrameworkInfo.plist
  • Ensure that you uncomment platform :ios, '9.0' in ios/Podfile
  • Ensure that ios/Podfile contains the following post install script:
    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'
        end
      end
    end

The following routine works for me when doing my production build:

    flutter clean \
        && rm ios/Podfile.lock pubspec.lock \
        && rm -rf ios/Pods ios/Runner.xcworkspace \
        && flutter build ios --build-name=1.0.0 --build-number=1 --release --dart-define=MY_APP_ENV=prod

Solution 2:

I solve it with this code, thanks! At the end of the 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

Solution 3:

This is because XCode 12 does only support building for the iOS target versions 9 - 14. Unfortunately the default iOS target set by flutter is 8. But you should be able to change the target in the ios/Runner.xcworkspace file using XCode. See flutter documentation section "Review Xcode project settings" -> headline "Deployment Target:".

You could also try updating flutter to 1.22 beta, which supports iOS 14 and XCode 12 (as noted here)

Solution 4:

go to Pods and for each framework you're using change the iOS version as shown in my screenshot

enter image description here

Solution 5:

I tried a bunch of things but what seems to have fixed this for me was:

flutter pub cache repair

https://dart.dev/tools/pub/cmd/pub-cache