I have already installed cocoapods in my Mac.
Cocoapods
$ pod --version
1.9.3
$ which pod
/Users/user/.rbenv/shims/pod
$ which gem
/Users/user/.rbenv/shims/gem
$ which ruby
/Users/user/.rbenv/shims/ruby
Problem
But if I add device specific codes like I setup firebase or add geolocator plugin, then clicking on Android studio Run green button, I always get below error:
Launching lib/main.dart on iPhone 11 Pro in debug mode...
Warning: CocoaPods not installed. Skipping pod install.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install:
sudo gem install cocoapods
CocoaPods not installed or not in valid state.
Error launching application on iPhone 11 Pro.
What didn't worked
- I updated Mac OS Catalina (10.15.6)
- I re-installed cocoapods couple of times, with different approaches (with homebrew, with system ruby, with rbenv ruby)
- Updated to latest xcode
It didn't worked
What works
Finally, if I run below command in terminal it is working as expected:
flutter build ios --simulator
flutter run
So, I think its an issue with Android Studio. anyone else facing this issue, and have workaround for this problem?
Requirement
- I want android studio to run project when I click on Android Studio Run icon.