flutter run on iOS or macOS stops with Error running pod install
Error running pod installShort answer
Flutter only reports that pod install failed; the reason is in the lines just above it. Run pod install yourself from the ios folder to see them. The common causes are CocoaPods missing or too old, a broken ffi gem on an Apple Silicon Mac, an out-of-date specs repository, a stale Podfile, or root-owned CocoaPods caches.
Fix it fast
1Find out which cause you have
Run the step Flutter ran, by hand, from the iOS folder. The real error prints above the Flutter summary.
cd ios pod install pod --version2Match what you see, then jump to its fix
- 1
Warning: CocoaPods not installed. Skipping pod install. / Warning: CocoaPods minimum required version 1.10.0 or greater not installed.CocoaPods is not installed, or is older than Flutter acceptsFix - 2
Error: To set up CocoaPods for ARM macOS, run:The ffi gem is broken on an Apple Silicon MacFix - 3
Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.The local CocoaPods specs repository is too old for a pod you needFix - 4
Warning: Podfile is out of dateThe Podfile in the project is out of dateFix - 5
Permission errors during pod install after an earlier run with sudoCocoaPods caches or folders are owned by rootFix
- 1
What does the error look like?
Error running pod installWarning: CocoaPods not installed. Skipping pod install.Error: To set up CocoaPods for ARM macOS, run:Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.Warning: Podfile is out of date
Cause 1 of 5
CocoaPods is not installed, or is older than Flutter accepts
1Check
pod --version should print a plain version number. Flutter's tool warns below 1.10.0 and recommends 1.16.2 or newer. If pod is not found at all, nothing was installed for the Ruby you are using.
which pod
pod --version2Fix
Install or update the gem. With the Ruby that ships with macOS you need sudo; with a Ruby from Homebrew or a version manager you do not. A user-level install avoids sudo, but then pod must be on your PATH.
sudo gem install cocoapods
# or, without sudo:
gem install cocoapods --user-install3Verify
The version prints, and Flutter stops warning about it.
pod --version
flutter doctor -vConfirmed by guides.cocoapods.org
Cause 2 of 5
The ffi gem is broken on an Apple Silicon Mac
1Check
Flutter's tool prints this message when pod install fails on an arm64 Mac and the output mentions ffi_c.bundle or a path containing /ffi/. Read the lines above the message to confirm.
pod install 2>&1 | grep -i ffi2Fix
Run the command Flutter prints: reinstall the ffi gem with libffi allocation enabled.
sudo gem uninstall ffi && sudo gem install ffi -- --enable-libffi-alloc3Verify
pod install now runs to the end.
cd ios
pod installConfirmed by raw.githubusercontent.com
Cause 3 of 5
The local CocoaPods specs repository is too old for a pod you need
1Check
A plugin was updated and wants a pod version your local specs copy has never seen. Flutter detects the phrase out-of-date source repos in the output and prints the hint.
pod install 2>&1 | grep -i -B2 -A2 "out-of-date"2Fix
Update the specs repositories, then install again.
cd ios
pod repo update
pod install3Verify
pod install finishes and writes Podfile.lock.
ls -l Podfile.lockConfirmed by raw.githubusercontent.com
Cause 4 of 5
The Podfile in the project is out of date
1Check
Flutter exits with this warning when the Podfile no longer matches what the current tool expects, typically after a Flutter upgrade on an old project. It tells you to remove the file so it can be generated again.
git diff --stat -- ios/Podfile2Fix
If you made no changes of your own to the Podfile, delete it and let Flutter write a new one. If you did, copy your additions aside first and put them back into the new file.
rm ios/Podfile
flutter pub get
flutter run3Verify
A new ios/Podfile exists and the build gets past pod install.
head -5 ios/PodfileConfirmed by raw.githubusercontent.com
Cause 5 of 5
CocoaPods caches or folders are owned by root
1Check
CocoaPods stopped running as root in version 0.32.0. Files created by a sudo pod install in the past can no longer be written by your normal user.
ls -ld ~/Library/Caches/CocoaPods ios/Pods2Fix
Remove the root-owned caches and the Pods folder, then install as your normal user.
sudo rm -fr ~/Library/Caches/CocoaPods/
sudo rm -fr ios/Pods/
cd ios && pod install3Verify
pod install runs as your user without a permission error.
ls -ld ios/PodsConfirmed by guides.cocoapods.org
How do I stop it coming back?
- Never run pod install with sudo; install the gem with sudo only if your Ruby requires it.
- Keep CocoaPods updated with the same gem command you installed it with.
- After a Flutter upgrade, run pod install once from the ios folder before opening Xcode.
- Commit Podfile.lock so everyone resolves the same pod versions.
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
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
pod install says there is no Podfile in the project directory
No Podfile found in the project directory
CocoaPods looks for a file named Podfile in the folder where you run the command.
2 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
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 doctor says CocoaPods is installed but not working
You appear to have CocoaPods installed but it is not working.
Flutter runs pod --version and treats a failed or unreadable result as a broken install.
3 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