2nd Ed Chapter 5 , section 5- Cocoapods error

I am using Android Studio BumbleBee on a MacBook Pro. I have the starter code loaded and it worked prior to the step to put the code into explore_screen.dart. Now the app will not run. It states;
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 Using packages | Flutter
To install see CocoaPods Guides - Getting Started for instructions.

CocoaPods not installed or not in valid state.
Error launching application on iPhone 8.
////////
I went into terminal on my mac and did the install of cocoapods and it ran without error. I restarted Android Studio but I get the same error about cocoapods. Then I checked StackOverflow and they said to uninstall and reinstall cocoapods and restart the IDE. I did that and it didn’t help. I saw another post that stated they had done a flutter run in the terminal. I tried that and it WORKS. as long as I do my run, hot reload and hot restart in the Terminal window ALL work fine. But when I click on the run Arrow in the IDE it errors with the cocoapods not installed or configured message. It is strange that the Terminal commands work without any errors and the app runs fine. ?? Maybe the new BUMBLEBEE version has cause some anomalies?

1 Like

Hi @naplesdave have you tried doing a

  1. flutter clean
  2. flutter pub get

Yes, no errors when I run that. I switched to an Android Nexus 6 for testing and all is well. When I try to use an iPhone on the MAC Simulator I get the error messages, but it runs fine if I run it from the terminal windows with flutter run.

Launching lib/main.dart on iPhone 8 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 Using packages | Flutter
To install see CocoaPods Guides - Getting Started for instructions.

CocoaPods not installed or not in valid state.
Error launching application on iPhone 8.

@naplesdave
Ah yes you need to install cocoapods so you can retrieve the frameworks/libraries for iOS

Instructions can be found here:

I had cocoapods installed already and everything was working fine under ARTIC FOX ver. After I ungraded to Android Studio BumbleBee I got the errors. I uninstalled CocoaPods and reinstalled it. Got no errors during that, restarted the Android Studio and got the CocoaPod errors when I was targeting a iOS iPhone 8 in the Simulator. If I use the Android Studio Terminal command line and do a flutter run and target the iPhone 8 it installs and runs fine. The error shows up when I use the IDE and press the run arrow. Not a deal breaker, just a bit annoying.

Had the same problem. It disappeared when I reverted to using the standard MacOS shell that I changed before into tcsh…
Took me a few days to find that out.

I didn’t change my default shell. It is currently /bin/zsh. Is that shell working for you?
Also. I’m on Monterey 12.1 MacBook Pro i9. I understand FLUTTER is making a new release announcement tomorrow at 1pm PST US time. Maybe it will solve some issues that the BumbleBee update caused as well?

As a temporary workaround, use your favorite shell to issue this command, which “motivates” Android Studio Bumblebee to (somehow) walk the right path:

open /Applications/Android\ Studio.app

I ran into this issue immediately upon upgrading to Android Studio Bumblebee 2021.1.1 on macOS Monterey (Intel).

This post describes this (still open) issue very clearly:

My shell is /bin/zsh as well, so that is the same. Then there might still be some issue(s) with what is in your .zshrc or .zprofile (path and environment settings). I would guess the settings for PATH, LANG are important. LANG because in my case in the compilation process for Iphone a complaint kept popping up that my LANG setting was incorrect.

Does the FLUTTER Team see these posts on StackOverflow and act on the BUG? Or has this been reported to them already?

I believe this is more of an Android Studio issue.

It would be great if Android Studio would say:

Can’t find CocoaPods in location /xxx/yyy/zzz/

so that we can then put the appropriate material in the expected path.

The side panel in this forum tells me that this topic has been solved. If so, where and how? Thanks.

I agree with you. It is an Android Studio issue. That is what was changed on my system when it acted up.

Interesting Note: I upgraded Flutter today to 2.10.0, Dart 2.16.0. My app still has the Cocoapods error so the updates did nothing to fix it. BUT…I created a test app that makes the starter Flutter app and ran it on a iPhone 8 sim and it compiled and ran totally error free! So it appears the issue is when you have an app that was created with an Earlier version of Android Studio then it errors. New apps are OK, on my MacPro Monterey, Intel i9.

1 Like

It looks like an issue with the Flutter plugin cocoapods not installed or not in valid state · Issue #5920 · flutter/flutter-intellij · GitHub
For now the workaround is the same you suggested above, or
chmod +x /Applications/Android\ Studio.app/Contents/bin/printenv

I had the same error and went through the same investigation. I’m on Monterey 12.2, Bumblebee 2021.1 Patch 1, Flutter API 32. I posted a question on Stack Overflow: https://stackoverflow.com/questions/70930325/android-studio-doesnt-find-cocoapods-when-the-package-flutter-inappwebview-is

The bare Flutter app coming from New Flutter Project runs fine. As soin as I add an import in pubspec.yaml, the CocoaPods error appears when I click Run from the IDE, but not when I do flutter run from the terminal.

I’ll try the chmod hint.

I just upgraded to Android Studio Bumblebee 2021.1.1.1.21 Patch 1 for Mac Intel. I opened a previous App and ran it from the IDE and the CocoaPods error has gone away. It seems that they have fixed it in this latest patch.

Great news. We can close this now. Thanks.

Yes, the CocoaPods Issue seems to be solved with this update. Now I can’t seem to open the Device Manager from the IDE. Both the Top toolbar icon and the tools menu options do Nothing. The only way I can seem to get to the Device Manager is from the Welcome screen options.
?

Press SHIFT twice and type Device Manager there.

Thanks, That works. I put the bug in a crash report for them already as well.