Flutter - Warning (CocoaPods not installed Skipping pod install) Even While Installed

3,172

Solution 1

This error started appearing in mac os after the update

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: 2048M
Cores: 8
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: com.bloc.intellij_generator_plugin (3.3.0), Dart (211.7798), andrasferenczi.dart-data-plugin (0.2.0), com.thoughtworks.gauge (211.6693.111), org.jetbrains.kotlin (211-1.6.10-release-923-AS7442.40), io.flutter (63.2.2), org.intellij.plugins.markdown (211.7142.37)

In my case, it is working to launch project in vs code, or running project with command flutter run

Android Canary last version solved problem

Update: As Ascot Harris mentioned, Android Studio Bumblebee | 2021.1.1 Patch 1 solves problem

Solution 2

In the app Terminal after open Simulator write

flutter run

in the Terminal

or close Android Studio and open terminal and paste

open /Applications/Android\ Studio.app

it will open the Android Studio and you can run as normal

Solution 3

Most of This is issues arise when you run flutter project on different machine.

To solve just follow the below steps and that will work

  1. cd ios
  2. pod install
  3. pod update
  4. Then clean your project
  5. Rebuild your project
Share:
3,172
Admin
Author by

Admin

Updated on December 31, 2022

Comments

  • Admin
    Admin over 1 year

    I am trying to build a Flutter app with Geolocator plugin on Android Studio. When I am running the app I have the following warning - that prevents the app from running:

    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 tried every solution i found in the internet (Stackoverflow & GitHub) but nothing seems to work.

    Important: When I tried to run the app from Xcode instead of from Android Studio, I had this error:

    The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.

    So what I did was - Change directory to ios (on the Flutter project) and running:

    pod init
    pod install
    

    Tried to run again from Xcode and it worked perfectly. After it works on Xcode I tried to run it from Android Studio and the same error happens to me, preventing the app to launch.

    Please help, I am spending hours on this error.

    Flutter Doctor:

    [✓] Flutter (Channel stable, 2.2.2, on macOS 11.4 20F71 darwin-x64, locale en-IL)
        • Flutter version 2.2.2 at /Users/idanrefaeli/Developer/flutter
        • Framework revision d79295af24 (5 weeks ago), 2021-06-11 08:56:01 -0700
        • Engine revision 91c9fc8fe0
        • Dart version 2.13.3
    
    [!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
        • Android SDK at /Users/idanrefaeli/Library/Android/sdk
        • Platform android-30, build-tools 30.0.3
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
        ✗ Android license status unknown.
          Run `flutter doctor --android-licenses` to accept the SDK licenses.
          See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
    
    [✓] Xcode - develop for iOS and macOS
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 12.5.1, Build version 12E507
        • CocoaPods version 1.10.1
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 4.2)
        • 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.8+10-b944.6916264)
    
    [✓] VS Code (version 1.57.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.23.0
    
    [✓] Connected device (2 available)
        • Idan’s (mobile) • 00008020-0011092101A2002E • ios            • iOS 14.6
        • Chrome (web)    • chrome                    • web-javascript • Google Chrome 91.0.4472.114
    
    ! Doctor found issues in 1 category.
    

    Extra logs: 'Run' log in Android Studio: pastebin.com/7iYtdcTQ Also this terminal log after running 'pod install': pastebin.com/1cCNuFYM

    -- UPDATE --

    I finally was able to run the app, all I did was to copy all the project files to a new project from scratch and it worked. Maybe it happened because of a certain conflict, since I imported someone else's project (from Angela Yu's Flutter Udemy course). Anyway, I still didn't find a fix for this fraustrating problem so if anyone recognizes something it would be great!