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

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

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

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)

Tags:

Ios

Xcode

Flutter