如何解决:Android许可证状态未知,也找不到Android sdkmanager工具?

时间:2020-02-29 10:16:10

标签: android flutter android-sdk-tools

尝试了所有我发现的东西(github问题,SO问题)。还尝试从Android Studio重新安装Android SDK(29)。

  1. 颤抖的医生

    C:\Users\Zheny>flutter doctor
    Doctor summary (to see all details, run flutter doctor -v):
    [√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.693], locale ru-RU)
    [!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
        X Android license status unknown.
          Try re-installing or updating your Android SDK Manager.
          See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed      instructions.
    [√] Android Studio (version 3.6)
    [!] VS Code (version 1.42.1)
        X Flutter extension not installed; install from
          https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
    [!] Connected device
        ! No devices available
    ! Doctor found issues in 3 categories.
    
  2. flutter doctor --android-licenses

    Android sdkmanager tool not found 
    (C:\Users\Zheny\AppData\Local\Android\Sdk\tools\bin\sdkmanager).
    Try re-installing or updating your Android SDK,
    visit https://flutter.dev/setup/#android-setup for detailed instructions.
    
  3. 颤抖医生-v

    C:\Users\Zheny>flutter doctor -v
    [√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.693], locale ru-RU)
    • Flutter version 1.12.13+hotfix.8 at C:\Flutter SDK\flutter
    • Framework revision 0b8abb4724 (2 weeks ago), 2020-02-11 11:44:36 -0800
    • Engine revision e1e6ced81d
    • Dart version 2.7.0
    
    [!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at C:\Users\Zheny\AppData\Local\Android\Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = C:\Users\Zheny\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
    X Android license status unknown.
      Try re-installing or updating your Android SDK Manager.
      See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed instructions.
    
    [√] Android Studio (version 3.6)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 44.0.2
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
    
    [!] VS Code (version 1.42.1)
    • VS Code at C:\Users\Zheny\AppData\Local\Programs\Microsoft VS Code
    X Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
    
    [!] Connected device
    ! No devices available
    
    ! Doctor found issues in 3 categories.
    
  4. 我的PATH和文件夹的屏幕 enter image description here enter image description here enter image description here

我该如何解决这个问题?

5 个答案:

答案 0 :(得分:2)

下载https://developer.android.com/studio#command-tools并提取

C:\ Users \ Zheny \ AppData \ Local \ Android \ Sdk文件夹

并这样设置路径

C:\ Users \ Zheny \ AppData \ Local \ Android \ Sdk \ tools \ bin

重新启动Power-shell或命令提示符 并执行 扑医生--android-licenses

答案 1 :(得分:1)

请按照以下步骤操作:

  1. 打开SDK Manager
  2. 使用SDK工具
  3. 从SDK Manager中删除“ Android SDK工具”
  4. 首先取消选择“隐藏已淘汰的软件包”,然后选择“ Android SDK Tools(已淘汰)”,进行安装。

  5. 运行flutter doctor --android-licenses并选择y作为提示。

运行扑扑医生,一切都会好起来!!!!

答案 2 :(得分:0)

根据您的安装路径, 您的系统变量应具有: ANDROID_HOME C:\ Users \\ AppData \ Local \ Android \ sdk JAVA_HOME C:\ Program Files \ Android \ Android Studio \ jre \

您的路径应具有: C:\ Program Files \ Android \ Android Studio \ jre \ bin C:\ src \ flutter \ bin

然后在命令提示符下运行“ flutter doctor”(不带引号)。

如果发生相同的错误,请打开Android Studio,转到“设置”,然后导航至“外观和行为>系统设置> Android SDK”,然后在窗口顶部和Android SDK位置的右侧,点击修改,然后从打开的窗口中更新当前的SDK Manager并安装最新的API(如果尚未安装);在此窗口中更新或安装完所有内容后,请关闭Android Studio并关闭命令提示符。

打开一个新的命令提示符,然后再次运行“ flutter doctor”(不带引号)。请按照软件说明接受所有Android许可证。

答案 3 :(得分:0)

遵循这些步骤

  • 打开Android Studio SDK管理器
  • 在“ Android SDK”标签中,取消选中“隐藏过时的软件包”
  • 检查Android SDK工具(已淘汰)

enter image description here

来源: https://flutter.dev/docs/get-started/install/macos#install-android-studio

答案 4 :(得分:0)

按照以下步骤操作

1. Open the Android Studio SDK Manager
2. Android SDK Command-line Tools (latest) 

安装这个。

enter image description here