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
IosXcodeCocoapodsIos SimulatorGoogle FabricIos Problem Overview
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.
My deployment target is 9.0
In my target
Ios Solutions
Solution 1 - Ios
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 - Ios
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.
Solution 3 - Ios
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 - Ios
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 - Ios
If anyone came here from react native issue, just delete the /build folder and type react-native run ios
Solution 6 - Ios
We can apply the project deployment target to all pods target. Resolved by adding this code block below to end of your Podfile:
post_install do |installer|
fix_deployment_target(installer)
end
def fix_deployment_target(installer)
return if !installer
project = installer.pods_project
project_deployment_target = project.build_configurations.first.build_settings['IPHONEOS_DEPLOYMENT_TARGET']
puts "Make sure all pods deployment target is #{project_deployment_target.green}"
project.targets.each do |target|
puts " #{target.name}".blue
target.build_configurations.each do |config|
old_target = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET']
new_target = project_deployment_target
next if old_target == new_target
puts " #{config.name}: #{old_target.yellow} -> #{new_target.green}"
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = new_target
end
end
end
Results log:
Solution 7 - Ios
Try these steps:
- Delete your Podfile.lock
- Delete your Podfile
- Build Project
- Add initialization code from firebase
cd /ios
pod install
- run Project
This was what worked for me.
Solution 8 - Ios
I solved this problem, I changed build system to Legacy Build System
from New Build System
In Xcode v10+, select File > Project Settings
In previous Xcode, select File > Workspace Settings
Change Build System to Legacy Build System
from New Build System
--> Click Done.
Solution 9 - Ios
If your are come from react-native
and facing this error just do this
- Open
Podfile
(your project > ios>Podfile) - comment flipper functions in podfile as below
#use_flipper!
#post_install do |installer|
#flipper_post_install(installer)
#end
- In terminal inside
IOS
folder enter this commandpod install
yep, that is it hope it works to you
Solution 10 - Ios
if anybody is experiencing is issue while updating to the latest react native, try updating your pod file with
use_flipper!
post_install do |installer|
flipper_post_install(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 11 - Ios
For Swift
If you are using CocoaPods with Xcode 12, then you have probably seen this error:
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.
This is happening because support for iOS 8 has been dropped, but the minimum deployment target for the pod is iOS 8.
Until this is fixed, you can add the following to your 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 will remove the deployment target from all the pods in your project and allows them to inherit the project/workspace deployment target that has been specified at the top of Podfile.
For React Native
Delete the ./project-root/ios/build folder and type react-native run ios
For Cordova
<preference name="deployment-target" value="8.0" />
Solution 12 - Ios
Simple fix that worked for me in Flutter:
- Delete
Podfile
andPodfile.lock
- Run app: This will create a new
Podfile
. This will probably still fail with an error. - In the new
Podfile
, uncomment and change the 2nd line toplatform :ios, '12.0'
(or other min version you want to target) - Run app again, now without errors
Solution 13 - Ios
This solution worked for me for Flutter. open {your_project_root_folder}/ios/Podfile
and replace the post_install block with this
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.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
end
end
Solution 14 - Ios
All you need to do is just uncomment the following line
# platform :ios, '8.0'
OR
# platform :ios, '9.0'
etc...
and then open iOS folder in the terminal and pass those commands:
% pod repo update
% pod install
Solution 15 - Ios
platform :ios, '10.0'
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
end
end
Solution 16 - Ios
for cordova developers having this issue
try to set
<preference name="deployment-target" value="8.0" />
in confix.xml
Solution 17 - Ios
most of the above did not work for me. If you dig around you will see that you aren't supposed to run pod install by hand. What worked for me was making sure my physical device was registered with xcode.
- open xcode workspace for ios. select your device (connected via usb most likely) and click Run. This will prompt you to let xcode register your device.
- xcode build will most likely fail which is ok - see next steps
- Quit Xcode!
- cd ios
- rm -fR Podfile Podfile.lock Pods
- in android studio choose the device in question and c
Solution 18 - Ios
first change the deployment to your choose : like '11.0' and add this step in the last of your pod file
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
end
end
end
Solution 19 - Ios
If anyone is getting this problem in 2021 after updating XCode to v13, here's a fix that worked for me:
https://github.com/facebook/react-native/issues/31733#issuecomment-924016466
However, this may not work for all react-native versions, it worked on v0.64 for me.
I used Xcode to create the dummy swift file so I automatically got a request for "Bridging Header"
Hopefully, this would be resolved in a future release.
Solution 20 - Ios
I had the same issue building my React Native project
cocoapods version update worked for me (upgraded from 1.8.4 to 1.11.2)
Solution 21 - Ios
Worked for me:
rm ios/Podfile
flutter pub upgrade
flutter pub get
cd ios && pod update
flutter clean && flutter run
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
Solution 22 - Ios
Xcode > Runner > Info deployment Target > IOS Deployment Target: 11 .
> open terminal :
pod cache clean --all
.
pod update
Solution 23 - Ios
This is a known issue on M1 MacBooks. Run flutter upgrade and that should fix it.
Currently working on M1 Mackbook 12.0.0 Flutter 2.10.0 Dart 2.16.0