Reputation: 6285
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.
Upvotes: 203
Views: 187445
Reputation: 1
If this happened after you update flutter or dart this means one of your global packages is back to the disabled
state.
in order to fix this just re-activate it. for me it was flutterfire and to fix it just run.
dart pub global activate flutterfire_cli
Upvotes: 0
Reputation: 439
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)
Upvotes: 18
Reputation: 9007
You need to update your pod file
iOS Project:
platform :ios, '13.6'
post_install do |installer| installer.generated_projects.each do |project| project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.6' end end end end
macOS Project:
platform :macos, '11.5'
post_install do |installer| installer.generated_projects.each do |project| project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '11.5' end end end end
Similar for tvOS & watchOS
tvOS - ['TVOS_DEPLOYMENT_TARGET'] = 'VERSION'
watchOS - ['WATCHOS_DEPLOYMENT_TARGET'] = 'VERSION'
That’s it, Cheers!
Upvotes: 8
Reputation: 1387
All these answers, and in fact, you can safely ignore those logs! 😏 They're just warnings, not errors!
If your build fails, it's because of something else, not this. Do a Command + F
in the output logs of your build and search for the word "error". That will tell you what the real problem is.
(Then again, if you REALLY want to get rid of those warnings, you can do a Command + Shift + F
in your Android Studio project, or just a global search of some sort if you're using a different IDE, and search for 'IPHONEOS_DEPLOYMENT_TARGET'. Then, everywhere you see that value set to '8.0' inside your pods, you can change it to '9.0' or '10.0' or whatever value you want that's within the specified range. This won't do anything to the function of your app, but you won't have to see the warnings again!)
Upvotes: 6
Reputation: 312
I recently upgraded nodejs with nvm and got this error (using React Native btw). I tried everything that does not require code changes. After switching back from nodejs 16 to 14, it worked again. But it wasn't the root cause. Try to read everything above the error. For me there was a line:
nvm is not compatible with the "npm_config_prefix" environment variable
After upgrading nvm from 0.33 to 0.39 it worked, even with nodejs 16
Upvotes: 0
Reputation: 31
Change MinimumOSVersion to 9.0 in /ios/Flutter/AppFrameworkInfo.plist.
Then in ios/Runner.xcodeproj/project.bpxproj replace
IPHONEOS_DEPLOYMENT_TARGET = 8.0
to IPHONEOS_DEPLOYMENT_TARGET = 9.0
in three lines.
It also works if you are building your .ipa whit codemagic
Upvotes: 3
Reputation: 1
After couple of days trying to figure out what to do.
The only thing that worked for me was deleting the entire ios directory in my Flutter project, then rebuilding it:
flutter create .
Add GoogleService-Info.plist
to Runner.
Add signing & capabilities in Xcode.
Add target properties in Xcode such as sign-in.
As mentioned in: https://stackoverflow.com/a/67224108/7749979
Upvotes: 3
Reputation: 9
I got so fed up, so I just compiled in Xcode 13. Works for me! Since upgrading to Flutter 2.5.2, I got this weird issue. Minor hassle.
ios/Podfile:
platform :ios, '10.0'
Upvotes: 1
Reputation: 536
In my case this error was misleading.
Turns out, the problem was caused by a missing step in Firebase upgrade docs: delete the Fabric build step in XCode.
Here's the article I found that actually solved the cause of this error for me: SO post towards the bottom it mentions the Fabric dependency.
I added the new Run Script in XCode per the firebase docs referenced, removed the Fabric related build phase, and the 8.0 target error went away.
I hope this helps anyone else who went down the PodFile dependency rabbit hole that I did.
Upvotes: 0
Reputation: 312
After trying most of these solutions the only thing that worked for me is to uncomment and add ios 10 in ios/Podfile:
platform :ios, '10.0'
Upvotes: 0
Reputation: 1
When updating to iOs 14.4 it seems that the path_provider package is not compatible with target 10.0. Currently Firebase package requires target 10.0. Here's the problem, I've had the problem for a month now. Maybe the Flutter team can help. When building iOs, there is an error that cannot be fixed, hic hic.
Launching lib/main.dart on iPhone 12 Pro in debug mode... Running pod install... Running Xcode build... Xcode build done. 29.4s Failed to build iOS app Error output from Xcode build: ↳ ** BUILD FAILED **
Xcode's output: ↳ In file included from /Users/maitrongtue/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.1/ios/Classes/FLTPathProviderPlugin.m:5: /Users/maitrongtue/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.1/ios/Classes/FLTPathProviderPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found #import <Flutter/Flutter.h> ^~~~~~~~~~~~~~~~~~~ 1 error generated. note: Using new build system note: Building targets in parallel note: Planning build note: Constructing build description
Could not build the application for the simulator. Error launching application on iPhone 12 Pro.
Upvotes: -2
Reputation: 83
Upvotes: 0
Reputation:
Just Follow Below Command Line in Your macOS
Upvotes: 0
Reputation: 116
For me what worked is, open XCode in ios folder. Then check and fix possible account related problem in Signing section. Then run flutter run
again. And it worked. Not sure why is it related to this error but it worked.
Upvotes: 2
Reputation: 163
Make sure, in any of your dart files has not imported the dart.html package. This caused a problem in my case when flutter tries to install the pod.
Upvotes: 1
Reputation: 825
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
Upvotes: 7
Reputation: 1521
go to Pods and for each framework you're using change the iOS version as shown in my screenshot
Upvotes: 23
Reputation: 3844
What worked for me is a combination of @raffaelli-l-c and @arhan-reddy-busam answer.
Ensure that you do the following:
MinimumOSVersion
to 9.0 in ios/Flutter/AppFrameworkInfo.plist
platform :ios, '9.0'
in ios/Podfile
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
Upvotes: 245
Reputation: 6285
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
Upvotes: 99