I am getting an error with Android Sdk when I run flutter doctor
on command-line
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v1.4.9-hotfix.1, on Mac OS X 10.14.4 18E226, locale zh-Hans-CN)
[!] Android toolchain - develop for Android devices (Android SDK version 28.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.io/setup/#android-setup for detailed instructions.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2)
[✓] Android Studio (version 3.3)
[✓] VS Code (version 1.33.1)
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
After following several possible fixes from the stackoverflow community, i still couldn't get it to work. Please i need assistance.
Here's what worked for me
%USERPROFILE%\AppData\Local\Android\Sdk
for windows, you should see a new folder tools
Note: If you don't see the tools
folder don't panic, i got you covered.tools
folder & navigate to bin
C:\Users\USERNAME%\AppData\Local\Android\Sdk\tools\bin
)sdkmanager
in the command-line. Try it out by typing sdkmanager
& hitting enter in CMD.'sdkmanager' is not recognized as an internal or external command, operable program or batch file.
you probably made a mistake while adding the path to System Environmental Variables. Fix that.c:/src/flutter
) & launch the flutter_console.bat
fileflutter doctor --android-licenses
and it should work. Accept all by typing y
and hitting ENTERflutter doctor
PS: Only if Fix 1 does not work for you!
tools
folderAfter extraction, copy the tools
folder to C:\Users\USERNAME%\AppData\Local\Android\Sdk
Now the same as Fix 1 above,
Open the tools
folder & navigate to bin
C:\Users\USERNAME%\AppData\Local\Android\Sdk\tools\bin
)sdkmanager
in the command-line. Try it out by typing sdkmanager
& hitting enter in CMD.'sdkmanager' is not recognized as an internal or external command, operable program or batch file.
you probably made a mistake while adding the path to System Environmental Variables. Fix that.sdkmanager
command from the command-line)tools
folder you added.Check Now
JAVA_HOME
and set the value to the JRE/bin (get it from Android studio install location in Program Files)set JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
for windows & export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
for LinuxAnd that's it you can now run flutter doctor --android-licenses
on the command-line; Accept all licenses by typing y
and hitting ENTER. And don't forget to run flutter doctor