Flutter error: "CocoaPods not installed or not in valid state."

Where does Android Studio expect to find CocoaPods? Could the problem be that Android Studio can't find the path to CocoaPods?

I'm using Android Studio Bumblebee 2021.1.1.

I'm trying to test my app on my iPhone from Android Studio. The error I get is

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.

Exception: CocoaPods not installed or not in valid state.

I ran gem list and the list of installed gems include:

cocoapods (1.11.2)
cocoapods-core (1.11.2)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.5.1)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
cocoapods-try (1.2.0)

I ran

I ran

flutter clean

I restarted Android Studio.

I ran File > Invalidate Caches… > Invalidate and Restart.

I ran

cd ios
pod install

This threw this error:

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).

What should I do now?

Post not yet marked as solved Up vote post of tdkehoe Down vote post of tdkehoe
16k views

Replies

For me this was resolved by opening the Android studio from terminal

open /Applications/Android\ Studio.app
  • this worked for me.

  • I think is a problem specific to Android Studio Bumblebee

  • As @Hardi mentioned, this is an Android Studio Bumblebee specific issue. Using the command that @naresh.kommana posted would work as a workaround until the issue is fixed. Downgrading your Android Studio (for instance to AS Arctic Fox) would also work. For a list of archived Android Studio versions refer to https://developer.android.com/studio/archive .

Yes. "Android Studio Bumblebee | 2021.1.1 Patch 1" fixed the issue.

  • temporary fix flutter build ios --simulator flutter run

    from the terminal the flutter doctor works correctly, from the terminal visual studio an error with cocopoads is given ... I think the problem is either with accesses or with paths, but I haven’t fixed it myself yet

Add a Comment

Error: No pubspec.yaml file found. This command should be run from the root of your Flutter project.