skip to Main Content

Somehow Android Studio does not find cocoapods, even though it is correctly installed in the system via brew install coocapods. The Android Studio console looks like it doesn’t get the correct PATH.

Note: Starting Android Studio through a terminal / iTerm with

open /Applications/Android Studio.app

does mitigate the issue, Android Studio then somehow gets the right path. But im wondering how i can archieve the same result for a start directly from the application directory / spotlight-search? Why does Android Studio not resolve the right PATH?

Android Studio Version 2021.1.1, macOS

Console output after click on "Flutter doctor":

/Users/[...]/flutter/bin/flutter doctor --verbose
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-x64, locale de-DE)
    • Flutter version 2.8.1 at /Users/[...]/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 30.0.3)
    • Android SDK at /Users/[...]/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • 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.

...

Starting a terminal in Android Studio or starting iTerm, output:

flutter doctor -v
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-x64, locale de-DE)
    • Flutter version 2.8.1 at /Users/[...]/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 30.0.3)
    • Android SDK at /Users/[...]/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • 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

...

4

Answers


  1. Chosen as BEST ANSWER

    Android Studio Bumblebee 2021.1.1.1.21 Patch 1 seems to have fixed this issue. In the release notes there is a similar issue mentioned:

    Issue #216364005: Env variables not sourced when launched from Mac OS X to Monterey Dock


  2. @scrimau wrote the best description of this issue.

    Here’s some further info:

    echo $PATH (using Android Studio’s Terminal) produces different results depending on which of the two methods is used to start Android Studio.

    The same directories appear in both echo $PATH results, but the directories are shuffled around.

    It almost seems like the sequence of directories (as shown by echo $PATH) might have something to do with the different behaviors.

    (Sorry: This should have been a comment. I can’t find a way to change an answer to a comment. I’ll be more careful next time.)

    Login or Signup to reply.
  3. I just installed the latest ANDROID STUDIO Bumblebee 2021.1.1.1.21 Patch 1 for Mac Intel. I loaded an older FLUTTER app into it and ran, (from the run arrow in the IDE), it against an iPhone 8 Simulator device. The CocoaPods error did NOT appear and the app launched in the Simulator device. It seems to me that this update has fixed that error.

    Login or Signup to reply.
  4. Fixed in Android Studio Bumblebee 2021.1.1.1.21 Patch 1 for Mac.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search