【问题标题】:flutter doctor not finding cocoa pods颤振医生没有找到可可豆荚
【发布时间】:2023-03-29 09:21:01
【问题描述】:

我有一个问题告诉我使用 gem 安装 cocoapods,但 flutter doctor 找不到。

    [✓] Flutter (Channel stable, 1.22.4, on macOS 11.0 20A2411 darwin-arm, locale en-IN)
    • Flutter version 1.22.4 at /Users/kirandhoundiyal/flutter
    • Framework revision 1aafb3a8b9 (3 weeks ago), 2020-11-13 09:59:28 -0800
    • Engine revision 2c956a31c0
    • Dart version 2.10.4

 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Volumes/apps/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /Volumes/apps/Android/sdk
    • ANDROID_SDK_ROOT = /Volumes/apps/Android/sdk
    • Java binary at: /Volumes/apps/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✗] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS
      development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
        sudo xcodebuild -runFirstLaunch
    ✗ 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 4.1)
    • Android Studio at /Volumes/apps/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)

[!] Connected device
    ! No devices available

! Doctor found issues in 3 categories.

gem list pod 也给出了一个空列表,但 sudo gem list pod 给出了这个

    *** LOCAL GEMS ***

cocoapods (1.10.0)
cocoapods-core (1.10.0)
cocoapods-deintegrate (1.0.4)
cocoapods-downloader (1.4.0)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-trunk (1.5.0)
cocoapods-try (1.2.0)

我是第一次做这种东西,需要帮助,怎么了?

编辑:ruby -v 给出了这个ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]

which ruby 给出了这个 - /usr/bin/ruby

【问题讨论】:

标签: xcode flutter cocoa


【解决方案1】:

尝试一一解决问题。首先使用

解决xcode问题
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch

之后 运行

sudo gem install cocoapods

===

如果这不起作用,请给出以下命令的输出。还可以判断是否安装了brew吗?

$ruby -v
===
$ which ruby
===

【讨论】:

  • 自制软件已安装。我在 mac mini M1 芯片上。
  • 那么你必须使用自制软件安装了 cocoapods。卸载旧的,然后你可以使用 -- sudo gem install cocoapods 安装。在此运行之后 gem install ffi
  • 我做了上面的步骤,但还是同样的问题。我从自制软件中删除了 cocoapods 并使用 gem 重新安装。编辑上述问题中给出的红宝石路径
【解决方案2】:

先试试这个;

sudo gem uninstall cocoapods
sudo gem install cocoapods

如果它不适合你。

试试这个 :(它适用于我的 macos Bigsur M1)

通过以下方式检查上述目录的权限:

ls -l /home/raphael/flutter/

如果没有,在上述文件夹中,尝试通过以下方式更改文件夹的权限:

chown -R YOUR_USERNAME flutter

再次运行第一个命令以验证适当的用户现在显示在文件夹中。然后尝试再次创建项目。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-12
    • 2020-03-11
    • 2021-01-28
    • 1970-01-01
    • 2019-06-09
    • 1970-01-01
    • 1970-01-01
    • 2020-10-11
    相关资源
    最近更新 更多