The annoying Cocoapods error - A troubleshooting guide
Google Developer Expert in Flutter & Dart π| Mobile App Development π±| Tech Advocate π| Women Who Code KL Director
Search for a command to run...
Google Developer Expert in Flutter & Dart π| Mobile App Development π±| Tech Advocate π| Women Who Code KL Director
No comments yet. Be the first to comment.
I've been using Bloc for years. It was my go-to state management solution, and I was comfortable with it. Events go in, states come out. Simple, predictable, testable. So when people kept telling me to try Riverpod, I resisted. Why fix what isn't bro...
I've dealt with my share of performance issues in production Flutter apps. Janky scrolling that makes users think the app is broken. Memory leaks that crash the app after 10 minutes of use. The kind of problems that make you question your life choice...
I've been building Flutter apps for a team of around 5 developers for the past few years. When I started, everyone talked about Clean Architecture like it was the only "professional" way to build apps. So naturally, I tried it. After months of writin...
Recently I talked about how to perform automated end-to-end testing on any mobile apps (yes, any, even those you donβt own) with Maestro.Deck: https://excalidraw.com/#json=YBaTDvWm8yTdshL8Z2IOL,7h7736K_Ey7wg08QljkbPg
Recently I gave a talk at Google DevFest Georgetown 2024, about asynchronous Dart features (now with quizzes built in!). Here are the slides I promised:
I lost count of how many times I encountered a Cocoapods error whenever I build a Flutter app for iOS or macOS, especially through VS Code. It looks like this:
Warning: CocoaPods is installed but broken. Skipping pod install.
You appear to have CocoaPods installed but it is not working.
This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
This can usually be fixed by re-installing CocoaPods. For more info, see https://github.com/flutter/flutter/issues/14293.
To re-install:
sudo gem install cocoapods
CocoaPods not installed or not in valid state.
The error message looks almost the same, even sometimes it was due to different reasons. I will share a couple ways that worked for me:
Try to exit VS Code completely (not just reload) and start again, sometimes this is all it needs to work.
Otherwise, uninstall the Flutter extension, reload, reinstall the Flutter extension, reload again.
If it still does not work, uninstall Cocoapods by sudo gem uninstall cocoapods , then install again with sudo gem install cocoapods . Make sure you only have one version of Cocoapods installed.
Sometimes it is because of incompatible dependencies in your Podfile. In that case delete Podfile.lock , then run pod install --repo-update in the ios directory of your Flutter project.
Hope this helps. I'm sure the future me will also visit this page from time to time π