Android / Sdk缺少工具文件夹,表示没有sdkmanager,表示“ Android许可证状态未知”错误

问题描述 投票:0回答:1

我想开始学习Flutter,所以我遵循了guide,但是我已经停留在第一步了。除了创建全新的应用程序外,我没有做任何其他事情,但是当我在Android Studio中点击“运行”时,出现以下错误:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
     build-tools;28.0.3 Android SDK Build-Tools 28.0.3
     platforms;android-28 Android SDK Platform 28
  To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
  Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

  Using Android SDK: /home/greg/Android/Sdk

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
Finished with error: Gradle task assembleDebug failed with exit code 1

[看有类似问题的人,最常见的解决方案似乎正在运行yes | ~/Android/tools/bin/sdkmanager --licenses,但我没有名为sdkmanager的文件夹或文件。我的整个文档树实际上是不同的,尽管我只是经历了Ubuntu的官方Android Studio下载过程。对于我的文档结构,我有

~/Android/Sdk/$ ls
build-tools  patcher    platform-tools  sources
emulator     platforms  skins  

都不包含工具,bin或sdkmanager。

我也在Android Studio中打开了SDK Manager,然后转到SDK Tools选项卡,更新了Build-Tools并接受了许可证,然后退出并重新打开了Android Studio,但是我遇到了同样的错误。我找不到与我具有相同文件结构的任何人。有人知道我能做什么吗?

编辑

我开始认为真正的问题是我的Android文件夹的内容。当我运行flutter doctor时,我会收到此消息

[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Linux, locale en_US.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    ✗ 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)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] IntelliJ IDEA Community Edition (version 2019.3)
[!] Connected device
    ! No devices available

! Doctor found issues in 3 categories.

但是当我运行flutter doctor --android-licences时,出现以下错误消息:

Android sdkmanager tool not found (/home/greg/Android/Sdk/tools/bin/sdkmanager).
Try re-installing or updating your Android SDK,
visit https://flutter.dev/setup/#android-setup for detailed instructions.

实际上,我没有工具文件夹,bin或sdkmanager。我确实尝试过卸载并重新安装Android Studio,但是没有任何改变。我下载了不正确的软件包或其他东西吗?我直接从https://developer.android.com/studio/#downloads下载了它,那么怎么可能内容似乎不正确?我有100GB的可用空间,因此空间有限并没有阻止其安装。

android android-studio gradle flutter android-sdk-manager
1个回答
0
投票

在终端或cmd中运行flutter doctor,然后键入y以接受许可证。

© www.soinside.com 2019 - 2024. All rights reserved.