0

STILL NOT SOLVED

I am setting up Android Studio on Mac Book with M1 Chip (Big Sur).

When editing a project with dependencies, I get a Cocopod error.

I tried reinstalling and reopening Android Studio with:

$ sudo gem install cocoapods

UPDATE

Following the guide: Running CocoaPods on Apple Silicon (M1)

What I did:

  • Right-click on Terminal in Finder
  • Get Info
  • Open with Rosetta
  • sudo arch -x86_64 gem install ffi

Until here no error message

. Then I tried to (In the Project of Android Studio with Rosetta deactivated)

  • Re-install dependencies arch -x86_64 pod install

and got the following error:

Traceback (most recent call last):
        5: from /usr/local/bin/pod:23:in `<main>'
        4: from /usr/local/bin/pod:23:in `load'
        3: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
        2: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:49:in `run'
        1: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:140:in `verify_minimum_git_version!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:128:in `git_version': Failed to extract git version from `git --version` ("") (RuntimeError)

My Ruby Version is:

 which ruby

ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]

UPDATE 27.06 I tried it again with a different Ruby Version and it still didn't work:

ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [arm64-darwin20]: Mac M1 - Cocoapods not working (Flutter) verify_minimum_git_version

Location:

ruby -v

/usr/bin/ruby




Content of .zshr file
export PATH="$PATH:/Users/timknogel/tools/flutter/bin"


rvm info

system:

  system:
    uname:        "Darwin Tims-MacBook-Pro.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 arm64"
    name:         "OSX"
    version:      "11.2"
    architecture: "arm64"
    bash:         "/bin/bash => GNU bash, version 3.2.57(1)-release (arm64-apple-darwin20)"
    zsh:          "/bin/zsh => zsh 5.8 (x86_64-apple-darwin20.0)"
    remote_path:  "osx/11.2/arm64"
    xcode:        "12.5"

  rvm:
    version:      "1.29.12 (latest)"
    updated:      "2 days 7 hours 56 minutes 14 seconds ago"
    path:         "/Users/timknogel/.rvm"
    autolibs:     "[4] Allow RVM to use package manager if found, install missing dependencies, install package manager (only OS X)."

  homes:
    gem:          "not set"
    ruby:         "not set"

  binaries:
    ruby:         "/usr/bin/ruby"
    irb:          "/usr/bin/irb"
    gem:          "/usr/bin/gem"
    rake:         "/usr/bin/rake"

  environment:
    PATH:         "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/timknogel/tools/flutter/bin:/Users/timknogel/.rvm/bin"
    GEM_HOME:     ""
    GEM_PATH:     ""
    MY_RUBY_HOME: ""
    IRBRC:        ""
    RUBYOPT:      ""
    gemset:       ""

My Git Version is:

% git version git version 2.30.1 (Apple Git-130)

Flutter doctor:

 flutter doctor -v                           
[✓] Flutter (Channel stable, 2.2.1, on macOS 11.2.2 20D80 darwin-arm, locale en-ES)
    • Flutter version 2.2.1 at /Users/timknogel/tools/flutter
    • Framework revision 02c026b03c (7 days ago), 2021-05-27 12:24:44 -0700
    • Engine revision 0fdb562ac8
    • Dart version 2.13.1

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/timknogel/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)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5, Build version 12E262
    ✗ 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.
      To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.

[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] 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)

[!] Connected device
    ! No devices available

! Doctor found issues in 3 categories.

ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]
  • try this https://stackoverflow.com/questions/64901180/running-cocoapods-on-apple-silicon-m1 by opening simulator on Rosetta – ajith Kumark Jun 03 '21 at 08:58
  • Thank you for your quick answer! So far it didn't solve it. I tried: Updated on 2021-06 June # Install ffi sudo arch -x86_64 gem install ffi # Re-install dependencies arch -x86_64 pod install. ---------> and get an error back: /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:128:in `git_version': Failed to extract git version from `git --version` ("") (RuntimeError) ---> This is weird though as I have git installed: MacBook-Pro multiculturalapp % git --version git version 2.30.1 (Apple Git-130) – Tim Knögel Jun 04 '21 at 10:26
  • "Library/Ruby/Gems/2.6.0/gems/cocoapods" There's the issue. Do not use Library Ruby. – matt Jun 04 '21 at 19:24
  • 1
    Hey Matt! By Library Ruby I understand that you mean Ruby versions installed with home-brew? I had them installed trying to solve that issue but right now I don't. I will update my post again so you can see which ruby version I use. – Tim Knögel Jun 05 '21 at 16:03
  • Still not working :,-( – Tim Knögel Jun 07 '21 at 06:58
  • I just can't make it work.... – Tim Knögel Jun 11 '21 at 19:18
  • I tried aswell this approach: https://www.youtube.com/watch?v=9xfRTp6tN5E&t=230s - but it didn't work neither. – Tim Knögel Jun 27 '21 at 18:36
  • I know uninstalled Homebrew and simplified my zshrc file. Still not working... – Tim Knögel Jul 20 '21 at 15:43
  • any solution @TimKnögel I have a similar problem. None of the answers I've found have worked.. – aheigins Nov 26 '21 at 15:15

1 Answers1

0

This error seems to be an ongoing issue related to GIT.

You can try running git --version and check if it returns a valid git version. If this still doesn't work, run brew install git. Otherwise this is another instance of this issue which is still open atm.

MαπμQμαπkγVπ.0
  • 5,887
  • 1
  • 27
  • 65