flutter doctor says CocoaPods is installed but not working
CocoaPods installed but not working.Short answer
Flutter runs pod --version and treats a failed or unreadable result as a broken install. The tool says this often happens when the Ruby that installed CocoaPods differs from the Ruby now used to run it, and that reinstalling usually fixes it. Find which pod runs, then reinstall the gem with the Ruby you actually use.
Fix it fast
1Find out which cause you have
Run the same command Flutter runs. If it fails or prints no version, you see the real error.
which -a pod pod --version2Match what you see, then jump to its fix
- 1
pod --version fails with a Ruby or gem errorCocoaPods was installed with a different Ruby than the one running itFix - 2
gem install fails with a permission error, or pod is not found after a sudo-less installGems were installed for the system Ruby without the right permissions or pathFix - 3
Warning: CocoaPods minimum required version 1.10.0 or greater not installed.CocoaPods is older than Flutter acceptsFix
- 1
What does the error look like?
CocoaPods installed but not working.You appear to have CocoaPods installed but it is not working.Warning: CocoaPods is installed but broken. Skipping pod install.
Cause 1 of 3
CocoaPods was installed with a different Ruby than the one running it
1Check
Flutter's own message names this case. See which ruby is first on the PATH and which gem command you used.
which ruby
ruby --version
which gem2Fix
Reinstall CocoaPods with the Ruby you use now. The CocoaPods guide says to install the gem again to update it; repeat the sudo if you used sudo the first time.
sudo gem install cocoapods3Verify
pod prints a version and flutter doctor stops warning.
pod --version
flutter doctorConfirmed by guides.cocoapods.org
Cause 2 of 3
Gems were installed for the system Ruby without the right permissions or path
1Check
The system Ruby needs sudo for gem install. Without sudo, the gem goes to a user directory that must be on the PATH.
gem environment2Fix
Either use sudo, or install a separate Ruby with Homebrew or a version manager, or install with --user-install and add the gem bin directory to your PATH.
gem install cocoapods --user-install3Verify
A new terminal finds pod.
which pod && pod --versionConfirmed by guides.cocoapods.org
Cause 3 of 3
CocoaPods is older than Flutter accepts
1Check
Flutter's tool requires at least 1.10.0 and recommends 1.16.2 or newer. Compare your version.
pod --version2Fix
Install the gem again; the guide says that is how to update, and --pre is only for pre-release versions.
sudo gem install cocoapods3Verify
pod --version shows a current version and flutter doctor is clean.
flutter doctorConfirmed by raw.githubusercontent.com
How do I stop it coming back?
- Pick one way to install Ruby gems (system with sudo, or a Ruby manager) and keep to it.
- After changing the Ruby version, reinstall CocoaPods before running flutter.
- Run flutter doctor after each macOS or Xcode update.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- Dispatch ProA real-time logistics platform: Flutter apps, Spring Boot services and a Kafka event pipeline on AWS.
- Qist BazaarA buy-now-pay-later marketplace built from a blank repo, now past 100K downloads on Google Play.
Related fixes
Mobile apps
Running pod on a React Native project fails with can't find gem cocoapods
can't find gem cocoapods (>= 0.a) with executable pod
The pod command exists, but the Ruby that is running it has no CocoaPods gem.
3 causes, each with a fixMobile apps
Apple rejected the app under Guideline 4.3, Design: Spam
Guideline 4.3(b) - Design - Spam
Guideline 4.3 is Apple's duplicate rule.
5 causes, each with a fixMobile apps
pod install cannot pick a version of a pod that satisfies every requirement
Specs satisfying the `FirebaseAuth (~> 11.0)` dependency were found, but they required a higher minimum deployment target.
CocoaPods tried every version of the named pod and none fit all requirements.
4 causes, each with a fixMobile apps
flutter run says: Could not run Runner.app, try Xcode Product > Run
Try launching Xcode and selecting "Product > Run" to fix the problem:
Flutter prints this when installing or launching the built app on the iPhone fails, and it hides the real reason.
4 causes, each with a fixMobile apps
flutter run on iOS or macOS stops with Error running pod install
Warning: CocoaPods not installed. Skipping pod install.
Flutter only reports that pod install failed; the reason is in the lines just above it.
5 causes, each with a fixMobile apps
FirebaseMessaging.getAPNSToken() returns null on iOS
FirebaseMessaging.instance.getAPNSToken() returns null
getAPNSToken() gives null when iOS has not handed the app an APNs token yet or never will.
4 causes, each with a fix