Android/SDK缺少“工具"文件夹,表示没有sdkmanager,表示"Android许可证状态未知".错误 [英] Android/Sdk is missing a Tools folder, meaing no sdkmanager, meaning "Android license status unknown" error

查看:723
本文介绍了Android/SDK缺少“工具"文件夹,表示没有sdkmanager,表示"Android许可证状态未知".错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I wanted to start learning Flutter, so I'm following the guide, but I'm already stuck on the very first step. I haven't done anything other than create a brand new app, but when I hit "Run" in Android Studio I get the following error:

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下载过程.对于我的文档结构,我有

Looking at people with similar problems, the most common solution seemed to be running yes | ~/Android/tools/bin/sdkmanager --licenses, but I don't have a folder or file called sdkmanager. My entire document tree is different actually, although I just went through the official Android Studio download process for Ubuntu. For my document structure, I have

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

都不包含工具,bin或sdkmanager.

none of which contain tools, bin, or sdkmanager.

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

I also opened SDK Manager in Android Studio, and went to the SDK Tools tab and updated Build-Tools and accepted the license, then quit and reopened Android Studio, but I'm getting the same error. I can't find anyone with the same file structure as me. Anyone know what I can do?

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

I'm starting to think the real issue is the contents of my Android folder. When I run flutter doctor I get this message

[✓] 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时,出现以下错误消息:

But when I run flutter doctor --android-licences I get the following error message:

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的可用空间,因此空间限制并没有阻止它的安装.我也没有任何互联网问题.

I don't in fact have a tools folder, or bin, or sdkmanager. I did try uninstalling and reinstalling Android Studio, but nothing changed. Did I download an incorrect package or something? I downloaded it directly from https://developer.android.com/studio/#downloads, so how is it possible that the contents seem to be incorrect? I have 100GB free, so space constraints didn't stop it from being installed. I don't have any internet issues either.

推荐答案

在MacOS上我也面临着同样的问题.

I'm facing the same issue too on MacOS.

我今天刚刚下载了Android Studio(android-studio-ide-192.6241897-mac),/tools文件夹也对我来说不见了.

I just downloaded the Android Studio today (android-studio-ide-192.6241897-mac) and the /tools folder is missing for me too.

我可以在"Android/"目录中看到"sdkmanager"的唯一方法是安装cmdline-tools并在bin文件夹中找到它.但这不能解决问题.

The only way i can see an 'sdkmanager' inside the 'Android/' directory is when i install cmdline-tools and find it in the bin folder. but that doesnt solve the problem.

编辑

找到了解决方案. 显然,最新的Android Studion版本中不存在"tools/"文件夹.

Found the solution. Apparently the 'tools/' folder doesn't exist in the latest Android Studion build.

您仍然可以使用Android Studio中的SDK管理器来安装SDK工具.

You can still install the SDK tools using the SDK manager in the Android studio.

打开SDK管理器,然后转到"SDK工具"标签.在底部,取消选中隐藏过时的软件包"复选框.

Open the SDK manager and go to the 'SDK Tools' tab. On the bottom uncheck the 'Hide Obsolete packages' checkbox.

执行此操作后,将显示安装"Android SDK工具(已淘汰)"软件包的选项.

After doing that an option to install the 'Android SDK Tools (obsolete)' package will appear.

安装它们,然后再次运行flutter doctor. 接受许可后即可使用

Install them and run the flutter doctor again. And it works after accepting the licenses

这篇关于Android/SDK缺少“工具"文件夹,表示没有sdkmanager,表示"Android许可证状态未知".错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆