Fix "CocoaPods could not find compatible versions for pod" on iOS
[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly"
- None of your spec sources contain a spec satisfying the dependency: `Firebase/CoreOnly (= 11.4.0)`.
- Specs satisfying the `GoogleSignIn (~> 8.0)` dependency were found, but they required a higher minimum deployment target.
- You have either: * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
- Error output from CocoaPods: [!] CocoaPods could not find compatible versions for pod "GoogleUtilities/Environment"
CocoaPods cannot find a version of a pod that satisfies every constraint (Podfile, Podfile.lock, plugins, minimum iOS target). Most of the time pod install --repo-update or pod update PodName fixes it; otherwise you need to raise platform :ios in the Podfile.
What this error means
During pod install, CocoaPods resolves a dependency graph: each pod (or Flutter / React Native plugin) requires a version range for its own dependencies, and Podfile.lock pins the versions already installed. If no version satisfies all constraints at once, or if the local spec index does not know the requested version yet, resolution fails. The block under the message is the key: it shows which pod asks for which version ("In Podfile" / "In snapshot (Podfile.lock)") and often the reason, such as an outdated index or a deployment target that is too low.
Common causes
- Outdated spec index: you just upgraded a package (Firebase, a Flutter plugin…) that requires a pod version your local CocoaPods cache does not know yet.
- Podfile.lock pins an old version: the lock requires for example
Firebase/CoreOnly (= 10.x)while the upgraded plugin asks for 11.x. - Minimum iOS target too low: the message "required a higher minimum deployment target" means the pod version needs a higher
platform :iosthan the one in the Podfile. - Two incompatible dependencies: two plugins require version ranges that do not overlap (e.g. two Google SDKs pinned differently).
- Typo or missing private source: wrong pod name, or a pod hosted on a private spec repo not declared with
sourcein the Podfile.
Step-by-step fix
-
Read the explanation block
Under the message, find the "In Podfile" and "In snapshot (Podfile.lock)" lines: they show which pod requests which version. If you see "higher minimum deployment target", jump straight to the
platform :iosstep. -
Update the spec index
This is the most common fix. Run it in the folder that contains the
Podfile(ios/for Flutter and React Native). For React Native, preferbundle execto use the project’s CocoaPods version.cd ios pod install --repo-update # React Native projects with a Gemfile bundle exec pod install --repo-update -
Unlock the pod pinned in Podfile.lock
If the lock forces an old version, update only that pod (and its dependencies). It is safer than updating everything at once.
pod update Firebase/CoreOnly -
Raise the minimum iOS target
Open
ios/Podfileand raiseplatform :iosto the version the pod requires (stated in its docs or podspec). Set the same value in Xcode: Runner/App target > General > Minimum Deployments.# ios/Podfile platform :ios, '15.0' -
Clean and reinstall (Flutter / React Native)
If the problem persists, start from a clean state. Deleting
Podfile.locklets CocoaPods update every pod: review the lock diff afterwards to check the version bumps before committing.# Flutter flutter clean && flutter pub get cd ios && rm -rf Pods Podfile.lock && pod install --repo-update # React Native cd ios && rm -rf Pods Podfile.lock && bundle exec pod install --repo-update -
Align package versions
If two plugins are incompatible, upgrade them together to versions released at the same time (e.g. the whole FlutterFire family with
flutter pub upgrade --major-versions, or all@react-native-firebase/*packages to the same version).
Did this fix work for you?
Confirm it in one click: it will rise for the next developers stuck on the same error.
Keep it from coming back
- Commit
Podfile.lockand update pods on purpose (pod update PodName), not by accident during anrm -rf. - Keep
platform :iosexplicit in the Podfile and aligned with the Xcode minimum target. - CocoaPods is in maintenance mode and its central repository is becoming read-only: for new projects, prefer Swift Package Manager when your dependencies support it.
Frequently asked questions
pod install or pod update?
pod install respects the versions in Podfile.lock; pod update (with or without a pod name) allows newer versions and rewrites the lock. Use pod install day to day and pod update PodName to unblock a dependency.
Is it bad to delete Podfile.lock?
It is not destructive, but every pod may jump to a newer version at once, which can introduce other errors. Do it as a last resort and check the diff.
On Apple Silicon, do I need to run pod with arch -x86_64?
Not anymore: CocoaPods runs natively on Apple Silicon with an up-to-date Ruby. That trick dates from 2021 and does nothing for an incompatible versions error.
Useful tools for this error
More Mobile (Android, iOS) errors
- Fix "SDK location not found" (ANDROID_HOME / sdk.dir) on Android
- Fix "Unable to load script" (index.android.bundle) in React Native
- Fix "Signing for "App" requires a development team" in Xcode
- Fix "INSTALL_FAILED_UPDATE_INCOMPATIBLE: signatures do not match" on Android
- Fix "Duplicate class ... found in modules" in an Android Gradle build
- Fix "cmdline-tools component is missing" and "Android license status unknown" (flutter doctor)
- Fix "Invariant Violation: "main" has not been registered" (React Native / Expo)