解决Flutter 中的 Android sdkmanager tool not found 问题

目录

1. 问题

1.1 flutter doctor

PS C:\Windows\system32> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.12.13+hotfix.9, on Microsoft Windows [Version 10.0.18363.720], locale zh-CN)
[!] 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)
[√] Connected device (1 available)

1.2 flutter doctor --android-licenses

PS C:\Windows\system32> flutter doctor --android-licenses
Android sdkmanager tool not found (C:\Users\Abc\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.

2. 解决

打开C:\Users\Abc\AppData\Local\Android\Sdk这个目录,发现没有tools这个文件夹
原因是在新版本tools文件夹已经不再使用了,但是仍然可以安装:
打开Tools -> SDK Manager -> SDK Tools , 取消勾选 Hide Obsolete Packages,勾选Android SDK Tools (Obsolete),再点Apply,下载安装
解决Flutter 中的 Android sdkmanager tool not found 问题

安装完成以后,再flutter doctor --android-licenses

PS C:\Windows\system32> flutter doctor --android-licenses
All SDK package licenses accepted.======] 100% Computing updates...

就没问题了。

上一篇:IDEA安装Flutter遇到的坑


下一篇:21-3-24 力扣每日刷题 456. 132 模式