简体   繁体   English

flutter 医生 - 如何解决 Android sdkmanager cmdline-tools 组件丢失?

[英]flutter doctor - How to resolve Android sdkmanager cmdline-tools component is missing?

Am trying to install/setup flutter_macos_2.10.2-stable on macOS Monterey 12.1.我正在尝试在 macOS Monterey 12.1 上安装/设置flutter_macos_2.10.2-stable

Java version: Java 版本:

echo $JAVA_HOME

Output: Output:

/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home

Have Android Studio Bumblebee 2021.1.1 Patch 1 installed (along with the flutter-dev 64.1.2 plug-in, also installed) inside Android Studio.在 Android Studio 中安装了Android Studio Bumblebee 2021.1.1 Patch 1 (同时安装了flutter-dev 64.1.2插件)。


Inside ~/.bash_profile :~/.bash_profile里面:

export ANDROID_HOME="/Users/pnwlover/Library/Android/sdk";

export FLUTTER_HOME="/Users/pnwlover/DevTools/flutter/flutter_macos_2.10.2-stable";

PATH="/usr/local/bin:$PATH:/usr/local/sbin:$FLUTTER_HOME/bin:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/tools/bin";

Now, when I run flutter doctor -v :现在,当我运行flutter doctor -v时:

flutter doctor -v
[✓] Flutter (Channel stable, 2.10.2, on macOS 12.1 21C52 darwin-x64, locale en-US)
    • Flutter version 2.10.2 at /Users/pnwlover/DevTools/flutter/flutter_macos_2.10.2-stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 097d3313d8 (3 days ago), 2022-02-18 19:33:08 -0600
    • Engine revision a83ed0e5e3
    • Dart version 2.16.1
    • DevTools version 2.9.2

[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/pnwlover/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ 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 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • 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.11+0-b60-7590822)

[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • 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

[✓] VS Code (version 1.44.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.102

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

When trying to do this:尝试这样做时:

sdkmanager --install "cmdline-tools;latest"

Receive the following warning:收到以下警告:

Warning: Unknown argument --install
Usage: 
  sdkmanager [--uninstall] [<common args>] [--package_file <file>] [<packages>...]
  sdkmanager --update [<common args>]
  sdkmanager --list [<common args>]
  sdkmanager --licenses [<common args>]

In its first form, installs, or uninstalls, or updates packages.
    By default, the listed packages are installed or (if already installed)
    updated to the latest version.

    --uninstall: uninstalled listed packages.

    <package> is a sdk-style path (e.g. "build-tools;23.0.0" or
             "platforms;android-23").
    <package-file> is a text file where each line is a sdk-style path
                   of a package to install or uninstall.
    Multiple --package_file arguments may be specified in combination
    with explicit paths.

In its second form (with --update), all installed packages are
    updated to the latest version.

In its third form, all installed and available packages are printed
    out.

In its fourth form (with --licenses), show and offer the option to
     accept licenses for all available packages that have not already been
     accepted.

Common Arguments:
    --sdk_root=<sdkRootPath>: Use the specified SDK root instead of the SDK 
                              containing this tool

    --channel=<channelId>: Include packages in channels up to <channelId>.
                           Common channels are:
                           0 (Stable), 1 (Beta), 2 (Dev), and 3 (Canary).

    --include_obsolete: With --list, show obsolete packages in the
                        package listing. With --update, update obsolete
                        packages as well as non-obsolete.

    --no_https: Force all connections to use http rather than https.

    --proxy=<http | socks>: Connect via a proxy of the given type.

    --proxy_host=<IP or DNS address>: IP or DNS address of the proxy to use.

    --proxy_port=<port #>: Proxy port to connect to.

* If the env var REPO_OS_OVERRIDE is set to "windows",
  "macosx", or "linux", packages will be downloaded for that OS.

What steps am I missing?我缺少哪些步骤?

How can I install Android's sdkmanager's cmdline-tools;latest ?如何安装 Android 的 sdkmanager 的cmdline-tools;latest

so simple just open android studio and goto settings and search for SDK and the in the Android SDK tab at right side second than open and you will see cmd line tool tick the box the apply button then flutter doctor with new terminal will show just one error and for solving that use this command keep agree with license and press y and enter this command after solving the first problem will work如此简单只需打开 android 工作室并转到设置并搜索 SDK 并在右侧第二个选项卡中的 Android SDK 选项卡中打开,您将看到 cmd 线工具勾选应用按钮然后 flutter 医生将只显示一个新错误的医生为了解决这个问题,请使用此命令保持同意许可并按 y 并在解决第一个问题后输入此命令将起作用

flutter doctor --android-licenses flutter 医生 --android-licenses

在此处输入图像描述 在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Flutter 医生:缺少 cmdline-tools 组件 - Flutter doctor: cmdline-tools component is missing Flutter 医生结果显示“缺少 cmdline-tools 组件” - Flutter doctor results with "cmdline-tools component is missing" Flutter - 缺少 cmdline-tools 组件 - Flutter - cmdline-tools component is missing 未找到 Android sdkmanager。 更新到最新的 Android SDK 并确保已安装 cmdline-tools 以解决此问题 - Android sdkmanager not found. Update to the latest Android SDK and ensure that the cmdline-tools are installed to resolve this 安装 Flutter 和 Android Studio 后出现错误“cmdline-tools 组件丢失”...我添加了 Android SDK。如何解决这些问题? - I am getting error "cmdline-tools component is missing" after installing Flutter and Android Studio... I added the Android SDK. How can I solve them? 我收到此错误“缺少 cmdline 工具组件”我已经安装了 flutter 和 android studio,如何解决它们,或者必须做什么? - I am getting this errors “cmdline tools component is missing” I have installed flutter and android studio, how to solve them, or what has to be done? cmdline-tools: 无法确定 SDK root - cmdline-tools : could not determine SDK root 键入 flutter 医生后找不到 sdkmanager --android-licenses - sdkmanager not found after typing flutter doctor --android-licenses 缺少 Android Studio sdkmanager 和 tools 文件夹 - Android Studio sdkmanager and tools folder is missing 无法使用最新的 cmdline-tools cli 运行模拟器 - Unable to run emulator using latest cmdline-tools cli
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM