CocoaPods could not find compatible versions for pod "Firebase/CoreOnly"
Solution 1
Try calling pod repo update
if the issue is not fixed
delete the Podfile.lock in the root directory, after that run pod install
Solution 2
Edit the minimum ios version in the podfile then run pod install.
Changing platform :ios, '9.0'
to platform :ios, '10.0'
then running pod install
fixed it for me.
Solution 3
🌟 For M1 Mac Users
- Go to
ios/Pods/Local Podspecs
directory in your project - Check every
json
file to find highest required iOS version. Mine was"ios": "10.0"
in some of them - Go back to
ios/ directory
- Open
Podfile
file - Uncomment
# platform :ios, '9.0'
and replace9.0
with version from step 2. - for example10.0
.
then here comes the M1 specific part
-
Run
sudo arch -x86_64 gem install ffi
-
Run
arch -x86_64 pod repo update
-
Run
arch -x86_64 pod install
error should be gone
- If using Flutter
cd -
back to your root directory - open iOS Simulator & runflutter run
10. ENJOY !🌟
If not working you might need to run flutter pub add firebase_core
to add firebase_core to your pubspec.yaml
file Before Step 1
If still not working try this BONUS STEPS :
-
Trying to Run directly from Xcode ? First Run
flutter build iOS
in your Flutter project -> then Run in Xcode -
Still not working
cd iOS
runrm -rf Pods/ Podfile.lock ; pod install
-
Still not working ? Search Keychain Access in Spotlight -> open -> Right-click on login -> Unlock (you will lock back when build succeeds)
-
Still not working ? make sure your Runner Info Configs look like this
Hope this helps ! Comment down bellow if still facing issues !
Solution 4
Just do a pod update
and then pod install
. This worked for me.
Solution 5
Execute
flutter clean
Go to
ios/
folder, editPodfile
and choose the platorm and version you want to launch. For example for platform ios and version 12.0 :
Podfile
# Uncomment this line to define a global platform for your project
platform :ios, '12.0'
Execute
pod update
Execute
pod install
(it can take a some minutes to download dependencies)Execute
flutter run
Luca Panteghini
I'm a senior developer and I like open source, Android and web developing. I try to continuously improve my knowledge and my skill.
Updated on February 20, 2022Comments
-
Luca Panteghini over 2 years
I've update my flutter package to the last versions and now IOS doesn't work anymore.
When I try to update the pods it's shows this error:
[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly": In Podfile: cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on Firebase/Firestore (~> 6.0) was resolved to 6.0.0, which depends on Firebase/CoreOnly (= 6.0.0) cloud_functions (from `.symlinks/plugins/cloud_functions/ios`) was resolved to 0.0.1, which depends on Firebase/Functions (~> 5.18) was resolved to 5.18.0, which depends on Firebase/CoreOnly (= 5.18.0)
Here my pubspec.yaml (Firebase related):
firebase_core: "^0.4.0" firebase_auth: "^0.11.0" firebase_analytics: "^3.0.0" cloud_firestore: "^0.11.0+1" cloud_functions: "^0.3.0" firebase_storage: "^3.0.0" firebase_messaging: "^5.0.1"
I've made various steps to try to fix:
flutter clean flutter build ios pod install pod update pod repo update pod install --repo-update
I've set platform :ios, '12.1' in Podfile and in Xcode as build target but nothing come back to works.
Here my podfile:
# Uncomment this line to define a global platform for your project platform :ios, '12.1' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' project 'Runner', { 'Debug' => :debug, 'Profile' => :release, 'Release' => :release, } def parse_KV_file(file, separator='=') file_abs_path = File.expand_path(file) if !File.exists? file_abs_path return []; end pods_ary = [] skip_line_start_symbols = ["#", "/"] File.foreach(file_abs_path) { |line| next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } plugin = line.split(pattern=separator) if plugin.length == 2 podname = plugin[0].strip() path = plugin[1].strip() podpath = File.expand_path("#{path}", file_abs_path) pods_ary.push({:name => podname, :path => podpath}); else puts "Invalid plugin specification: #{line}" end } return pods_ary end target 'Runner' do use_frameworks! # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock # referring to absolute paths on developers' machines. system('rm -rf .symlinks') system('mkdir -p .symlinks/plugins') # Flutter Pods generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig') if generated_xcode_build_settings.empty? puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first." end generated_xcode_build_settings.map { |p| if p[:name] == 'FLUTTER_FRAMEWORK_DIR' symlink = File.join('.symlinks', 'flutter') File.symlink(File.dirname(p[:path]), symlink) pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) end } # Plugin Pods plugin_pods = parse_KV_file('../.flutter-plugins') plugin_pods.map { |p| symlink = File.join('.symlinks', 'plugins', p[:name]) File.symlink(p[:path], symlink) pod p[:name], :path => File.join(symlink, 'ios') } end post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['ENABLE_BITCODE'] = 'NO' end end end
-
emrcftci over 3 years
rm -rf Podfile.lock
thenpod install
worked for me. -
Julian Schmuckli about 3 yearsWorked perfect, when I have changed it in Xcode under "Runner" -> "Runner" -> "Info" -> "iOS Deployment Target" to version >= 10.0.0
-
Ajay Gautam about 3 yearsFor M1 macs: alias pod="arch -x86_64 pod"
-
easeccy over 2 yearsThanks. Step 6,7 and 8 solved the issue for me on an M1 Mac.
-
Mohammed_7aafar over 2 yearsthanks alot it worked for me because I'm m1 user.
-
Engin Yilmaz over 2 yearsI got "bad cpu type" error on step 6 so that I installed the ffi by running this command "arch -x86_64 brew install libffi" if I am not wrong than this command also install the ffi
-
Huthaifa Muayyad over 2 yearsHERO, took two days to figure out the M1 settings, although they were working on M1 but for some reason it stoped. And pod install or update never worked again until those methods. Thanks again.
-
Karatekid430 about 2 yearsIf you are having to run any pod installs inside Rosetta then your machine is not set up correctly.
-
Noshaid Ali about 2 yearsAlso if you are developing a react-native application using yarn run
yarn add all
-
Ashonko about 2 yearsThanks a lot. Hovering here and there with different solutions but yours finally solved my problem on M1.
-
Faiizii Awan about 2 yearsflutter 3 not working for me
-
tcffm almost 2 yearsThanks a lot, you saved my day! Worked on my M1.