flutter doctor --android-licenses does not work
Asked Answered
F

5

6

when I run flutter doctor I noticed license status is unknown.

[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.17763.253], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    X Android license status unknown.
[√] Android Studio (version 3.3)
[√] IntelliJ IDEA Ultimate Edition (version 2018.3)
[!] VS Code (version 1.30.2)
[!] Connected device
    ! No devices available

! Doctor found issues in 3 categories.

I found that in order to resolve the license I need to run this command flutter doctor --android-licenses. when I run that I get the following error:

The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
A newer version of the Android SDK is required. To update, run:
C:\Users\myusername\AppData\Local\Android\sdk\tools\bin\sdkmanager --update

So I then tried running C:\Users\myusername\AppData\Local\Android\sdk\tools\bin\sdkmanager --update I received the below error:

'E\AppData\Local\Android\Sdk\tools\bin\' is not recognized as an internal or external command,
operable program or batch file.
Error: Could not find or load main class com.android.sdklib.tool.sdkmanager.SdkManagerCli

I looked everywhere online and could not find any answer. I am new to flutter and do not know how to resolve this problem. Any help would be great thanks!

Faro answered 9/2, 2019 at 2:21 Comment(0)
F
1

Open Command Prompt and access into Android SDK directory, then execute above command.

sdkmanager --update
Forrest answered 9/2, 2019 at 5:24 Comment(5)
I have tried this. I cd to the directory and then try the command. No luck.Faro
I get the same error: 'E\AppData\Local\Android\Sdk\tools\bin\' is not recognized as an internal or external command, operable program or batch file. Error: Could not find or load main class com.android.sdklib.tool.sdkmanager.SdkManagerCli I also tried adding the sdkmanager location to my path... Same error.Faro
it means either you're in wrong AndroidSDK directory or you haven't installed AndroidSDKForrest
I have used the Android SDK with Android Studio. Does this mean it is installed? If so do you know where Android Studio default install location is?Faro
if android studio is working go to preferences and search "sdk" to find default android sdk directoryInstar
L
5

In Android Studio, you should check to ensure that the Android SDK Command-line Tools are installed. Adding this fixed the issue for me in Flutter.

android studio setttings

Lagoon answered 1/6, 2021 at 15:34 Comment(0)
F
1

Open Command Prompt and access into Android SDK directory, then execute above command.

sdkmanager --update
Forrest answered 9/2, 2019 at 5:24 Comment(5)
I have tried this. I cd to the directory and then try the command. No luck.Faro
I get the same error: 'E\AppData\Local\Android\Sdk\tools\bin\' is not recognized as an internal or external command, operable program or batch file. Error: Could not find or load main class com.android.sdklib.tool.sdkmanager.SdkManagerCli I also tried adding the sdkmanager location to my path... Same error.Faro
it means either you're in wrong AndroidSDK directory or you haven't installed AndroidSDKForrest
I have used the Android SDK with Android Studio. Does this mean it is installed? If so do you know where Android Studio default install location is?Faro
if android studio is working go to preferences and search "sdk" to find default android sdk directoryInstar
V
0

If the Android Sdk Command Line Tools is ticked and you are still facing the error above, Simply uninstall it by unticking it and reinstall back by ticking it again like shown in the image below. Hopefully this helps

enter image description here

Vestigial answered 30/10, 2023 at 13:47 Comment(0)
A
0

check for the sdk folder permissions, a Mac thing!

Auteur answered 18/4 at 19:24 Comment(0)
A
0

sudo /home/user/Programs/flutter/bin/flutter doctor --android-licenses worked.

flutter setup for Mac this command works for me.

after that

Review licenses that have not been accepted (y/N)? y

I accepted the licenses, I got

Accept? (y/N): y All SDK package licenses accepted

Hope it works for you!

Amedeo answered 4/7 at 9:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.