Flutter Mac Book M1 您似乎安装了 CocoaPods 但它不起作用

时间:2021-06-03 08:42:09

标签: ios git flutter cocoapods

仍未解决

我正在使用 M1 芯片 (Big Sur) 在 Mac Book 上设置 Android Studio。

在编辑具有依赖项的项目时,出现 Cocopod 错误。

我尝试重新安装并重新打开 Android Studio:

$ sudo gem install cocoapods

更新

遵循指南: Running CocoaPods on Apple Silicon (M1)

我做了什么:

  • 在 Finder 中右键单击“终端”
  • 获取信息
  • 用 Rosetta 打开
  • sudo arch -x86_64 gem install ffi

直到这里没有错误信息

。然后我尝试(在禁用 Rosetta 的 Android Studio 项目中)

  • 重新安装依赖 arch -x86_64 pod install

并得到以下错误:

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)

我的 Ruby 版本是:

 which ruby

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

UPDATE 27.06 我用不同的 Ruby 版本再次尝试它,但它仍然不起作用:

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

地点:

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:       ""

我的 Git 版本是:

% git 版本 git 版本 2.30.1 (Apple Git-130)

颤振医生:

 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]

0 个答案:

没有答案