35

My app was working fine until I did 2 small changes.

  1. On Target runner in Xcode I enabled bitcode for the project.
  2. I update the Android studio to the latest version.

Android Studio Bumblebee | 2021.1.1 Build #AI-211.7628.21.2111.8092744, built on January 19, 2022 Runtime version: 11.0.11+0-b60-7590822 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. macOS 12.0.1 GC: G1 Young Generation, G1 Old Generation Memory: 1280M Cores: 4 Registry: external.system.auto.import.disabled=true Non-Bundled Plugins: Dart (211.7798), org.jetbrains.kotlin (211-1.6.10-release-923-AS7442.40), io.flutter (63.2.2)

After that When I run my flutter app on iOS simulator I'm getting this error. Although I have disabled bitcode and tried again.I got same error. I installed and reinstalled cocapoads still same error. I don't know what causing this error. Can you help? please

 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.
 Error launching application on iPhone 13.
Kaushal Kishore
  • 447
  • 1
  • 5
  • 13

8 Answers8

27

UPD: Fixed in 2021.1.1 patch 1, see release notes here

This might happen because AndroidStudio doesn't know anything about $PATH provided in ~/.*rc files (.bashrc,.zshrc, etc.)

You can ensure by launching it from terminal:

open /Applications/Android\ Studio.app

EDIT: It's a confirmed bug in Bumblebee release

The workaround is to add missing flag:

chmod +x /Applications/Android\ Studio.app/Contents/bin/printenv

You have to do it only once

  • 3
    open in terminal works... from dock not :-( – Maurice Raguse Jan 27 '22 at 10:15
  • 1
    If you are not sure how to edit the profile to add the path, this is a good short step by step writeup: https://www.architectryan.com/2012/10/02/add-to-the-path-on-mac-os-x-mountain-lion/ – bm888 Jan 27 '22 at 14:48
  • Still can't get this to work I have updated the .zhhrc and .profile with `export PATH="$PATH:/usr/local/bin` but still does not work. Tried `Invalidate Cache & Restart` even restarted my mac and still no luck. – Craig Howell Feb 03 '22 at 14:27
  • Updated the answer, with a working fix. It is a confirmed bug of Bumblebee release. – Buffer Underflow Feb 03 '22 at 20:18
  • I tried that but now I'm getting this error: CocoaPods' output: ↳ CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update – Kaushal Kishore Feb 04 '22 at 08:26
  • Very helpful fix before the patch. For those who can't update Android studio with the latest patch just run the above command with a `-x` instead of a `+x` and then try updating. @BufferUnderflow it would be great if you could add this to your answer. Thanks – Devenom Feb 10 '22 at 21:34
  • I can confirm that running Android Studio from terminal solved the issue. – nelsonspbr Jun 15 '22 at 18:45
11

Open terminal run -> chmod +x /Applications/Android\ Studio.app/Contents/bin/printenv

Try again...And it should work.

Mostafa Soliman
  • 725
  • 6
  • 20
  • This is the actual answer. The binary seems to have no execute permissions after update. Cheers – MousyBusiness Feb 03 '22 at 21:47
  • I tried that but now I'm getting this error: CocoaPods' output: ↳ CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update – Kaushal Kishore Feb 04 '22 at 08:26
9

I got an exception on the pod availability check.

which pod

It seems that $PATH env for the updated studio is not picked properly. (you can check it by enabling verbose logging mode on the flutter plugin).

Workaround is to start Android studio from the terminal:

open /Applications/Android\ Studio.app 

Updated: Android Studio Bumblebee (2021.1.1) Patch 1 fixes this issue.

Eugene Kalinin
  • 208
  • 4
  • 5
7

I came across this problem too using Android studio on Apple Silicon MacBook launching from command line or directly both failed

I updated the ruby version to 2.7.3 using rbenv, and then it worked from the command line.

open /Applications/Android\ Studio.app

Note: default macOS system ruby is version is 2.6.8, and there are some incompatible gems with this version

Daren Hayward
  • 141
  • 1
  • 4
2

If the top voted solution doesn't fix this for you with the Bumblebee release, then you can try the beta Chipmunk release of Android Studio.

I am running the M1 Mac and this version 2021.2.1 Beta 1 is able to run the flutter apps from the toolbar correctly.

enter image description here

bm888
  • 541
  • 5
  • 10
0

I've searched all of solutions, and current post's answers do the trick. But basically it seems like flutter android studio(only lately-updated bumblebee version) plug-in triggers the pod error, since both xcode and android studio terminal run work just fine.

We might have to keep tracking this issue. Before flutter team gives a clear answer, i'm planning to use flutter run --debug, since terminal run provides "r" for hot reload and "R" for hot restart. Or we can also use open /Applications/Android\ Studio.app everytime.

tsitixe
  • 1,851
  • 3
  • 14
  • 24
0

I fixed it by running:

sudo gem install ffi
MobileMon
  • 8,341
  • 5
  • 56
  • 75
0

In my case i check $PATH variable and in this do not exist path to pod executable

Using MacBook Pro M1 with pod installed by brew

WiRight
  • 335
  • 6
  • 9