Skip to content

CocoaPods not installed or not in valid state #54962

Closed
@medlmd

Description

@medlmd

Hello I get this problem when I try to launch my app on android studio (on Mac ):

Warning: CocoaPods is installed but broken. Skipping pod install.
  You appear to have CocoaPods installed but it is not working.
  This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
  This can usually be fixed by re-installing CocoaPods. For more info, see https://github.com/flutter/flutter/issues/14293.
To re-install:
  sudo gem install cocoapods

Exception: CocoaPods not installed or not in valid state.

flutter doctor

   Woah! You appear to be trying to run flutter as root.
   We strongly recommend running the flutter tool without superuser privileges.
  /
📎
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v1.18.0-5.0.pre.89, on Mac OS X 10.15.4 19E287, locale en-TN)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[!] Xcode - develop for iOS and macOS (Xcode 11.4.1)
    ✗ CocoaPods installed but not working.
        You appear to have CocoaPods installed but it is not working.
        This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
        This can usually be fixed by re-installing CocoaPods. For more info, see https://github.com/flutter/flutter/issues/14293.
      To re-install CocoaPods, run:
        sudo gem install cocoapods
[✓] Android Studio (version 3.6)

Activity

VladyslavBondarenko

VladyslavBondarenko commented on Apr 17, 2020

@VladyslavBondarenko

Hi @medlmd
does the proposed command sudo gem install cocoapods help?

added
in triagePresently being triaged by the triage team
waiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter responds
on Apr 17, 2020
medlmd

medlmd commented on Apr 17, 2020

@medlmd
Author
removed
waiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter responds
on Apr 17, 2020
avvari-da

avvari-da commented on Apr 17, 2020

@avvari-da

sudo gem install cocoapods this worked for me. Although there were some issues (suggestions came up). Ran the following additionally (in same order):

  • sudo gem pristine ffi --version 1.12.2
  • sudo gem pristine executable-hooks --version 1.6.0
  • sudo gem pristine gem-wrappers --version 1.4.0
  • sudo gem regenerate_binstubs
  • sudo gem pristine --binstubs

Hope this helps!

VladyslavBondarenko

VladyslavBondarenko commented on Apr 17, 2020

@VladyslavBondarenko

@medlmd
could you check workarounds from #14293?

medlmd

medlmd commented on Apr 18, 2020

@medlmd
Author

sudo gem install cocoapods this worked for me. Although there were some issues (suggestions came up). Ran the following additionally (in same order):

  • sudo gem pristine ffi --version 1.12.2
  • sudo gem pristine executable-hooks --version 1.6.0
  • sudo gem pristine gem-wrappers --version 1.4.0
  • sudo gem regenerate_binstubs
  • sudo gem pristine --binstubs

Hope this helps!

Hello, I get this
sudo gem pristine executable-hooks --version 1.6.0
ERROR: While executing gem ... (Gem::Exception)
Failed to find gems ["executable-hooks"] = 1.6.0

removed
waiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter responds
on Apr 18, 2020
VladyslavBondarenko

VladyslavBondarenko commented on Apr 20, 2020

@VladyslavBondarenko

@medlmd
doesn't it help #41291 (comment)?
(you can try with 1.9.0 version)

medlmd

medlmd commented on Apr 20, 2020

@medlmd
Author
removed
waiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter responds
on Apr 20, 2020
changed the title [-]I can't launch my app [/-] [+]CocoaPods not installed or not in valid state[/+] on Apr 21, 2020

10 remaining items

jmagman

jmagman commented on May 11, 2020

@jmagman
Member

@jrnelson333 Can we get logs with the verbose -v flag?

jmagman

jmagman commented on May 19, 2020

@jmagman
Member

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!

Thanks for your contribution.

oakmad

oakmad commented on May 28, 2020

@oakmad

Resolved:
Turns out it wasn't an issue with cocoapods per se. I did three things

  1. sudo gem update
  2. I fired up Xcode which I had forgotten I had updated and it required additional components to be installed.
  3. I restarted visual studio code

After that everything worked just fine.

Original report:

I'm encountering the same issue, with debug not running on the iOS simulator when flutter doctor checks out OK. If I find a solution I will post it here.

Error when running debug:

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:
  sudo gem install cocoapods

CocoaPods not installed or not in valid state.

Doctor output:

▶ flutter doctor -v
[✓] Flutter (Channel stable, v1.17.1, on Mac OS X 10.15.5 19F96, locale en-US)
    • Flutter version 1.17.1 at /Users/xxx/flutter
    • Framework revision f7a6a7906b (2 weeks ago), 2020-05-12 18:39:00 -0700
    • Engine revision 6bc433c6b6
    • Dart version 2.8.2


[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/xxx/Library/Android/sdk
    • Platform android-29, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.5, Build version 11E608c
    • CocoaPods version 1.9.2

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 44.0.2
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.45.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.10.2

[✓] Connected device (2 available)
    • Nokia 2 2     • xxxxxxx                  • android-arm64 • Android 10 (API 29)
    • iPhone 11 Pro • xxxxxx • ios           • com.apple.CoreSimulator.SimRuntime.iOS-13-5 (simulator)

• No issues found!
edgarfroes

edgarfroes commented on May 28, 2020

@edgarfroes

Just did what the @oakmad said above and it worked. In my case, it was the Dart plugin for VS Code that was awaiting for a restart to update, so I had to close and reopen VS Code, got the "Dart Code has been updated to 'xxx'" and I was able to debug on my device properly.

zentby

zentby commented on May 29, 2020

@zentby

Very weird. It even complains after I upgraded the cocoapods:
image

zentby

zentby commented on May 29, 2020

@zentby

it turns out that my path has the wrong version of gems.
image
It was pointing to the 2.6.0 folder. After I switched to 2.7.0, problem solved.

export PATH="/usr/local/lib/ruby/gems/2.7.0/bin:$PATH"

22 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    toolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @oakmad@qnub@jmagman@netgfx@bhagn

        Issue actions

          CocoaPods not installed or not in valid state · Issue #54962 · flutter/flutter