flutter android sdk没有发现当尝试到接受android许可证没有这使用android studio

hgc7kmma  于 2022-12-27  发布在  Flutter
关注(0)|答案(1)|浏览(187)

我试图学习flutter,但我遇到了安装问题,一切都很好,直到我运行flutter医生,它指出,我必须接受android许可证。
请记住,我的工作没有Android Studio,所以我正在寻找一个解决方案,不包括需要Android Studio的修复
有很多人有同样的问题,但几乎所有的修复我已经看到包括android工作室
我单独安装了命令行工具,并将其安装在我的SDK文件夹中,我这样做是因为我不想使用Android Studio,但Visual Studio的Flutter工作.

[√] Flutter (Channel stable, 3.3.10, on Microsoft Windows [Version 10.0.19044.2364], locale de-DE)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.4)
[!] Android Studio (not installed)
[√] VS Code (version 1.74.2)
[√] Connected device (3 available)
[√] HTTP Host Availability

我尝试接受许可证时的输出:

C:\Users\Tim\AppData\Local\Android\Sdk\cmdline-tools\bin>flutter doctor --android-licenses
Android sdkmanager not found. Update to the latest Android SDK and ensure that the cmdline-tools are installed to resolve this.

我已经尝试通过flutter config重新安装cmdline-tools来移动我的SDK路径,更新查找更新或更新版本的cmdline工具的路径
如果有人想查看所有版本,这是我运行flutter doctor -v时的输出

C:\Users\Tim\AppData\Local\Android\Sdk\cmdline-tools\bin>flutter doctor -v
[√] Flutter (Channel stable, 3.3.10, on Microsoft Windows [Version 10.0.19044.2364], locale de-DE)
    • Flutter version 3.3.10 on channel stable at C:\Users\Tim\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 135454af32 (10 days ago), 2022-12-15 07:36:55 -0800
    • Engine revision 3316dd8728
    • Dart version 2.18.6
    • DevTools version 2.15.0

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at C:\Users\Tim\AppData\Local\Android\Sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: C:\Program Files\Common Files\Oracle\Java\javapath\java.exe
    • Java version Java(TM) SE Runtime Environment (build 18.0.2.1+1-1)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.4)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.1.32407.343
    • Windows 10 SDK version 10.0.19041.0

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

[√] VS Code (version 1.74.2)
    • VS Code at C:\Users\Tim\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19044.2364]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 108.0.5359.125
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 108.0.1462.54

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

! Doctor found issues in 2 categories.

请记住,其中一个问题是没有安装android studio,但没有它应该也能正常工作,所以技术上有一个问题

在我的cmdline工具文件夹中有另一个包含最新文件夹的cmdline工具文件夹是否正常
还是最新的文件夹应该直接在Cmdline工具中

e5njpo68

e5njpo681#

将系统环境变量中的PATH变量更新为sdkmanager所在的位置。
为此:转至Windows〉搜索环境变量〉转至“编辑系统环境变量”〉创建新变量或将其添加到现有PATH变量中,如“C:\Users\Tim\AppData\Local\Android\Sdk\cmdline-tools\latest\bin”
然后重新启动命令提示符,然后键入flutter doctor --android-licenses
单击y或Yes接受所有策略
然后运行flutter doctor -v并检查问题是否得到解决

相关问题