Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android Studio BumbleBee 2021.1.1]: flutter doctor shows CocoaPods not installed. Skipping pod install #97251

Closed
NathanMDT opened this issue Jan 25, 2022 · 49 comments
Labels
customer: crowd Affects or could affect many people, though not necessarily a specific customer. platform-mac Building on or for macOS specifically t: flutter doctor Problem related to the "flutter doctor" tool tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@NathanMDT
Copy link

NathanMDT commented Jan 25, 2022

Thanks for the feedback! If your issue is related to the Flutter framework itself,
please open an issue at
github.com/flutter/flutter.

Steps to Reproduce

Debug flutter project

Flutter doctor run from command
Says CocoaPods not installed.

And YES, I have tried uninstalling and reinstalling cocoacpods dozens of times.
IT IS INSTALLED.
But Android Studio doesn't know that.

Version info

Please paste the output of running flutter doctor -v here (available from the command
line or from Tools > Flutter > Flutter Doctor). It will provide the version of the
Flutter framework as well as of the IntelliJ plugin.
Very interesting that the output of the flutter doctor from the command line is different from that of Tools-> Flutter >Flutter Doctor

First, from running flutter doctor -v
no issues are found.

[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-x64, locale en-US)
    • Flutter version 2.8.1 at /Users/Nathan.mellor/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (6 weeks ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/nathan.mellor/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/nathan.mellor/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)

[✓] Connected device (3 available)
    • Pixel 3 (mobile)   • 8A9X0NAVC                            • android-arm64  • Android 12 (API 31)
    • iPhone 13 (mobile) • 0B466EB6-F0CB-4477-9745-A1B550143BC3 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 97.0.4692.99

• No issues found!

But if using the menu option:

/Users/nathan.mellor/flutter/bin/flutter doctor --verbose
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-x64, locale en-US)
    • Flutter version 2.8.1 at /Users/nathan.mellor/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (6 weeks ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/nathan.mellor/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ✗ CocoaPods not installed.
        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 see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)

[✓] Connected device (3 available)
    • Pixel 3 (mobile)   • 8A9X0NAVC                            • android-arm64  • Android 12 (API 31)
    • iPhone 13 (mobile) • 0B466EB6-F0CB-4477-9745-A1B550143BC3 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 97.0.4692.99

! Doctor found issues in 1 category.
Process finished with exit code 0

@stevemessick stevemessick transferred this issue from flutter/flutter-intellij Jan 25, 2022
@stuartmorgan
Copy link
Contributor

Where is Cocoapods installed? The most likely explanation for the difference is that it's in a location that's in your path in a terminal, but not for UI applications.

@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Jan 26, 2022
@darshankawar
Copy link
Member

@NathanMDT
Check above comment and confirm the location in your path is correct.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 26, 2022
@kolotum
Copy link

kolotum commented Jan 26, 2022

This happened after I upgraded to Android Studio Bumblebee (2021.1.1) on Mac (Apple Silicon).

No issues with the previous Android Studio version before.

@alod2019
Copy link

alod2019 commented Jan 26, 2022

The same issue with AS Bumblebee on a Mac with Intel CPU

@NathanMDT
Copy link
Author

Is this I check where my cocoapods are installed?
% gem which cocoapods
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods.rb
How do I check whether that is in Android Studio's path?

I have tried installing it through brew as well.

It is also on AS Bumblebee on a Mac. The Mac recently had an update to 12.1.
Xcode at /Applications/Xcode.app/Contents/Developer

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 26, 2022
@darshankawar
Copy link
Member

Please check below links and see if they help:

#97072 (comment)
#93475 (comment)

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 27, 2022
@liorboyango
Copy link

While the debug & run buttons on Android Studio fail due to the above, 'flutter run' works

@alod2019
Copy link

alod2019 commented Jan 27, 2022

To clarify - the problem happens only when a flutter command (Doctor or build) is triggered from AS Bumblebee menu.
There are no problems with AS Arctic Fox and VS Code.
Flutter commands in AS Bumblebee terminal window are also executing Ok.

@alod2019
Copy link

alod2019 commented Jan 27, 2022

A workaround from Stackoverflow is to start Android studio from the terminal:

open /Applications/Android\ Studio.app 

@exitist
Copy link

exitist commented Jan 27, 2022

I've also tested workarounds in #97072 (comment) #93475 (comment) and bunch of command line workarounds, but nothing works. All conditions are same as above comments.

I'm doing my job with flutter run --debug from AS terminal. Clicking r/R is doing hot reload/restart, so it is not that critic. I guess it may be a AS flutter-dart plugin issue..

(+ my mac os desktop app is working well with AS menu's play button && after flutter clean in that desktop project, launching with play button for mac os desktop doesn't work too, but flutter run -d macos works. It seems like flutter clean triggers the first pod-not-installed error)

@MarkBurvs
Copy link

Getting this issue on my M1 Macbook after updating to Bumblebee. Normal terminal and terminal in Android Studio both find pod okay, and flutter doctor reports no problems. Running flutter from the command line works fine (in AS too), but pressing the run or debug buttons on the AS toolbar give the error.
As suggested above, launching AS from the command line makes everything work.
I've tried adding the path to pod to my .zshrc file, but that doesn't help. For some reason, AS just can't find it.

@IonVillarreal
Copy link

IonVillarreal commented Jan 27, 2022

For now, download the previous preview version: Android Studio Bumblebee (2021.1.1) RC 1

https://developer.android.com/studio/archive

@blue492
Copy link

blue492 commented Jan 27, 2022

I have same issue and this problem appear when I upgraded to the new Android version, only in Mac when I try to do: Build -> Flutter -> Build iOS it shows this warning:

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 see https://guides.cocoapods.org/using/getting-started.html#installation for instructions. CocoaPods not installed or not in valid state. Process finished with exit code 1

More info here
https://github.com/flutter/flutter/issues/97374

How to fix it?
Regards

@mariopepe
Copy link

mariopepe commented Jan 27, 2022

Crazy that this goes to production to millions of users... spent hours now.... boring and lame.

For me, the fix was to launch open /Applications/Android\ Studio.app

But honestly, I'm so disappointed. You handled this like it's a game, this is my actual job, I do not open Android Studio to spend hours fixing dumb issues.......

@mark8044
Copy link

mark8044 commented Jan 28, 2022

This is nuts. Been at a standstill now, thinking its a widespread bug and would be surely addressed quickly.
Not only can you not launch any iOS simulator apps but the android device manager also doesn't work after the bumblebee upgrade.

So do we wait more or will this take weeks/months to address?

Do you all think this solution would help any?
https://stackoverflow.com/a/63506237

@darshankawar
Copy link
Member

Thanks for your patience. I understand that this behavior is occuring using the latest version of Android Studio, ie, https://developer.android.com/studio/releases#bumblebee and based on above reports, it occurs on Intel as well as on M1.
Based on above reports, I am going ahead and labeling it.

/cc @christopherfujino

@darshankawar darshankawar added t: flutter doctor Problem related to the "flutter doctor" tool tool Affects the "flutter" command-line tool. See also t: labels. and removed waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds in triage Presently being triaged by the triage team labels Jan 28, 2022
@darshankawar darshankawar changed the title Says Cocoapods not installed despite all attempts Flutter commands triggered from Android Studio Bumblebee version (2021.1.1) shows CocoaPods not installed. Skipping pod install Jan 28, 2022
@darshankawar darshankawar added customer: crowd Affects or could affect many people, though not necessarily a specific customer. platform-mac Building on or for macOS specifically labels Jan 28, 2022
@MarkBurvs
Copy link

MarkBurvs commented Jan 28, 2022

@mark8044 You can double-press shift to do a global search search and type "Virtual Device Manager" to open the device manager and that works. Just not from the button on the top bar or the menu.

@stevemessick
Copy link
Member

@TatsuUkraine since launching from the terminal fixes the issue, it really sounds like the path is defined in a script that gets run when you create a new shell after having logged in. For the IDE to see it, the path must be defined when running the login script. And, as I mentioned, everything works for me, which strongly suggests there is no problem in the plugin.

@TatsuUkraine
Copy link

TatsuUkraine commented Jan 29, 2022

I was rebooting and relogin yesterday and today. I didn't change any env variables. Only one difference between now and then - ide and plugin versions. And it was the same on 2 different MacBooks Intel and m1 based

@mark8044
Copy link

@mark8044 You can double-press shift to do a global search search and type "Virtual Device Manager" to open the device manager and that works. Just not from the button on the top bar or the menu.

Can confirm this works. Thank you very much for this tip!
But hopefully this is all sorted out quickly because for now I have to do your trick, in addition to launching studio from command line and doing a pod update for every dependency upgrade. Its getting old real quick :)

Thanks again

@mark8044
Copy link

mark8044 commented Jan 29, 2022

One more thing: the problem with the device manager is related to a bug in the Flutter plugin. The device manager only launches if the project has an Android module. If you add an Android module to your Flutter project then the device manager works. flutter/flutter-intellij#5464 (comment) has more info. I'm working on a fix for the problem but I'm not sure when it will be ready.

Im probably not understanding what you mean about an Android module to flutter project, but my app is primarily used on Android, and flutter doctor -v shows I successfully have android SDK installed, but this bug is occurring for me

For now what I'm doing to get things to work as pre-bumblebee are

  1. Launch Android studio from terminal with: open /Applications/Android\ Studio.app
  2. Open Device manager by: press shift twice and then type Virtual Device Manager
  3. When trying to run on iOS simulator, from terminal have to cd ios then type pod update to get cocoa pods parts updated, then I can run the app on the simulator successfully. This is only necessary when you update one of the dependencies

This has become my daily routine to get things going, hopefully this helps others and hopefully things get back on track

Thanks

@NegiMManish
Copy link

If open /Applications/Android\ Studio.app makes everything work, then this may be an issue with environment variables getting out of sync. If that's the case, logging out and logging back in (to reset the global shell and reload its envars) might fix the underlying problem.

Could someone who's experiencing the problem try that and report back here?

it doesn't fix anything for me either

@NegiMManish
Copy link

  1. open /Applications/Android\ Studio.app

thanks a lot it does work for me . Almost wasted a day to find something meaningful .
Thank you

@jperezr21
Copy link

One solution if using zsh is to do

echo "source ~/.zshrc" > ~/.profile

then log out and log back in. Now when I open Android Studio from the dock I can launch Flutter apps in the iOS simulator.

@TatsuUkraine
Copy link

TatsuUkraine commented Jan 30, 2022

@jperezr21 doesn't work for me

what flutter doctor says when you launch it from package.yaml actions (top right corner)? If we talking about launching the app on the simulator, the fact that it started to work for you may not mean that you fixed the issue. It may simply mean that pod install wasn't invoked during app build. SInce Pod installation doesn't invoke each time you build the app, I think it invokes only when iOS deps are changing ro you building the app after flutter clean

@jperezr21
Copy link

@TatsuUkraine you're right, when running flutter doctor from pubspec.yaml I get

✗ CocoaPods not installed.

so ignore my comment above.

@aruizcanton
Copy link

A workaround from Stackoverflow is to start Android studio from the terminal:

open /Applications/Android\ Studio.app 

Thanks a lot for the solution.
I spent a whole day looking for a solution.

@TatsuUkraine
Copy link

so I just installed Android Studio Arctic Fox | 2020.3.1 Patch 4, and I can say that all works fine there

@stevemessick
Copy link
Member

[I meant to post this Sunday but forgot to click Comment. I did post it in Flutter plugin issues.]

It turns out, I did not do a proper test (as I claimed in a previous comment). It is broken for me, too.

For some reason Android Studio Bumblebee is not getting the PATH from the login shell. I found this:

Screen Shot 2022-01-30 at 10 30 46 AM

That's the default value of PATH before any shell script runs. Not very useful for us. (In case anyone needs to know how to find that, I used the Flutter plugin to create a Java project in Android Studio -- something you should not be able to do. Then I added a run config for an Application and used the environment variable tool to display the values.)

If I look at the same dialog using Chipmunk (canary) it shows a proper PATH value.

I don't know how to fix it yet, but I'm going to talk with my team about possibilities.

@stevemessick
Copy link
Member

stevemessick commented Jan 31, 2022

Update: We planned to release a new version of the plugin on Feb 1 but have decided to hold that until we have a fix for this problem. We have a couple possible solutions, but neither is likely to happen overnight.

So, for now, the work-arounds are to go back to Arctic Fox or launch from a terminal via:
open /Applications/Android\ Studio.app

If you installed Android Studio from the JetBrains Toolbox the path will be different, something like:
open ~/Library/JetBrains/Toolbox/apps/AndroidStudio/ch-0/211.7628/AndroidStudio.app
(I'm guessing the path. There may be a space in Android Studio, ch-0 might be something else, and the version number may be different. But, that seems to be the pattern.)

@stevemessick
Copy link
Member

Update: The Android Studio team is already aware of the problem. I don't know when it will get fixed but I expect a patch soon-ish.

There is another work-around, that you only have to do once.

The workaround is to add missing flag: chmod +x /Applications/Android\ Studio.app/Contents/bin/printenv

If you are using JetBrains Toolbox, then printenv file location would be different. Check installation path in (kebab menu) / Setting / Configuration for Android Studio tool, and adjust command above accordingly.

@harnit-bakshi

This comment has been minimized.

@TatsuUkraine
Copy link

The workaround is to add missing flag: chmod +x /Applications/Android\ Studio.app/Contents/bin/printenv

If you are using JetBrains Toolbox, then printenv file location would be different. Check installation path in (kebab menu) / Setting / Configuration for Android Studio tool, and adjust command above accordingly.

this worked! thank you)

@stevemessick

This comment was marked as resolved.

@christopherfujino

This comment has been minimized.

@stevemessick
Copy link
Member

There is a new version of Bumblebee available that fixes this issue.

@stevemessick
Copy link
Member

If the menu item Check for Updates does not prompt you to update you can download it directly from https://developer.android.com/studio/archive

@mark8044
Copy link

mark8044 commented Feb 5, 2022

There is a new version of Bumblebee available that fixes this issue.

I think it successfully fixes the CocoaPods issue, at least I'm not getting that anymore as far as I can tell.

However the device manager still doesn't work?

@TatsuUkraine
Copy link

@mark8044 I don't know if it's related to bumblebee update or not, I was able to solve it by adding Android to the project structure in the settings

@mark8044
Copy link

mark8044 commented Feb 5, 2022

@mark8044 I don't know if it's related to bumblebee update or not, I was able to solve it by adding Android to the project structure in the settings

For me it broke with the first Bumblebee upgrade

With that said, when you say project structure where do you find that?

thanks!

@TatsuUkraine
Copy link

@mark8044

Снимок экрана 2022-02-06 в 01 30 46

then click on the project name and Add button

Снимок экрана 2022-02-06 в 01 37 29

And select the Android option there

Снимок экрана 2022-02-06 в 01 31 52

I personally didn't change any input values and saved it as it is

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer: crowd Affects or could affect many people, though not necessarily a specific customer. platform-mac Building on or for macOS specifically t: flutter doctor Problem related to the "flutter doctor" tool tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

No branches or pull requests