flutter doctor 一直报错Android licen

2020-03-03  本文已影响0人  走在长长地路上

按照flutter安装步骤一步步执行
执行flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.3 19D76, locale zh-Hans-CN)
 
[!] 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.
 
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[✓] Android Studio (version 3.6)
[✓] VS Code (version 1.42.1)
[✓] Connected device (3 available)

! Doctor found issues in 1 category.

一直报错 Android license status unknown。
网上有很多执行flutter doctor --android-licenses命令,然后一路y就能解决问题的,对我没用。
我执行以后显示的是:

flutter doctor --android-licenses
Android sdkmanager tool not found (/Users/suying/Library/Android/sdk/tools/bin/sdkmanager).
Try re-installing or updating your Android SDK,
visit https://flutter.dev/setup/#android-setup for detailed instructions.

还有说在将 android-sdk/emulator/bin 目录拷贝至 android-sdk/tools/,我发现android/sdk/路径下压根没有tools文件夹。我想可能是我android环境变量配置有问题,后来在.bash_profile配置ANDROID_HOME和PATH等变量,问题还是没有解决。
又尝试在Android Studio中SDK Platform和SDK Tools 下载各种SDK,依然没有起作用。

后来在stackoverflow发现一个回答:
I had this issue when I installed on KUbuntu. You need to open AndioStudio In SDK Manager -> SDK Tools uncheck 'Hide Obsolete packages.. download and install Android SDK Tools(Obsolete).

Android Studio SDK Manager

默认Hide Obsolete是选中的,将其选中给取消,然后下载Android SDK Tools(Obsolete),下载完以后/Users/suying/Library/Android/sdk这个路径下出现了tools文件夹,再执行flutter doctor,就完全没有问题了。

上一篇下一篇

猜你喜欢

热点阅读