CocoaPods could not find compatible versions for pod Firebase/Core” cloud_firestore, Flutter
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Introduction
This CocoaPods error means the iOS dependency constraints declared by your Flutter plugins do not overlap. In Firebase setups, this often happens when firebase_core and cloud_firestore plugin versions are out of sync or local pod metadata is stale. The fix is version alignment first, then clean iOS resolution with minimal manual pinning.
Understand the Constraint Chain
In Flutter, plugin versions are resolved by pub, then each plugin brings iOS pod constraints through its podspec. CocoaPods tries to satisfy all those constraints at once.
A conflict appears when one plugin requires a Firebase pod range that another plugin cannot accept. Editing random pod versions in Podfile can hide the root issue and make upgrades harder later.
Start with the Flutter layer, not CocoaPods overrides.
Align Flutter Firebase Plugins Together
List current dependency graph:
Then upgrade related Firebase plugins as a group in pubspec.yaml, not one package at a time. After update:
Check pubspec.lock and verify firebase_core and cloud_firestore are from compatible release families.
Refresh iOS Resolution State
After Flutter alignment, rebuild iOS pod resolution from a clean but controlled state:
If the error persists, read the exact conflicting version lines from CocoaPods output. Map each pod back to the plugin version in pubspec.lock so you know which package is driving the constraint.
Keep Podfile Minimal and Modern
Use a modern iOS platform target that current Firebase plugins support. Avoid aggressive manual pinning unless absolutely required.
Too many hardcoded pod versions in Podfile can fight the plugin-tested combinations and create recurring conflicts.
Use Temporary Overrides Carefully
Sometimes you need a short-term override to unblock. If so, document it and remove it once plugin versions catch up.
After adding any override, run full app validation on device and simulator. A successful install is not enough if runtime initialization breaks.
Validate Runtime Integration After Resolution
Once pod install succeeds:
Then verify Firebase initialization and one Firestore read or write path. Dependency resolution can succeed while runtime setup fails due to incorrect app configuration files or platform settings.
Add CI Guardrails
Prevent recurring conflicts by ensuring Flutter and iOS lock state move together in pull requests.
Example CI sequence:
If pubspec.lock changed but Podfile.lock is stale, fail the build and request lockfile refresh. This catches drift early.
Troubleshooting Flow That Avoids Random Changes
Use this order:
- Check Firebase plugin version compatibility in Flutter.
- Refresh
pub getand inspect lockfile. - Re-resolve pods with updated specs.
- Add temporary pin only if absolutely needed.
- Remove temporary pin when upstream compatibility is available.
Sticking to this order reduces trial-and-error loops and keeps your dependency graph maintainable.
Common Pitfalls
- Upgrading
cloud_firestorewithout upgrading related Firebase plugins. - Pinning many pod versions manually and diverging from plugin support matrix.
- Skipping
pod repo updateand resolving against stale metadata. - Keeping too old iOS deployment target for current plugin requirements.
- Stopping at install success without runtime Firebase validation.
Summary
- The error is a constraint mismatch across Flutter plugins and CocoaPods.
- Solve at the Flutter plugin layer first, then re-resolve iOS pods.
- Keep
Podfileminimal and avoid long-term manual pod pins. - Rebuild lock state cleanly and verify runtime Firebase behavior.
- Add CI checks so dependency drift is caught before merge.
Related reading
- CocoaPods could not find compatible versions for pod Firebase/CoreOnly
- Cocoapods Failed to connect to GitHub to update the CocoaPods/Specs specs repo
- CocoaPods not installed or not in valid state
- Cocoapods setup stuck on pod setup command on terminal
- Cocoapods setup stuck on pod setup command on terminal
- Cocoapods staying on analyzing dependencies
- Cocoapods Warning - CocoaPods did not set the base configuration of your project because because your project already has a custom config set
- Codable class does not conform to protocol Decodable
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.