Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
571 views
in Technique[技术] by (71.8m points)

java - Cannot run flutter doctor --android-licenses

I want to use flutter on my computer, I use Android Studio and Visual Studio Code. when I was running a flutter doctor, a warning like this appeared,

[√] Flutter (Channel stable, v1.17.3, on Microsoft Windows [Version 10.0.14393], locale id-ID)
[!] 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 visit
      https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions.
[√] Android Studio (version 4.0)
[√] VS Code (version 1.45.1)
[!] Connected device
    ! No devices available

! Doctor found issues in 2 categories.

but when there I run the flutter doctor --android-licenses there is an error like this, and the error is the same as I run the command sdkmanager

C:UsersHalim>flutter doctor --android-licenses
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
        at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
        at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
        at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
        at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
        at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        ... 5 more

in this situation I use jdk-13.0.1 and have added it to the path environment, and currently I use Windows 10

for the environment variable I use the settings as follows

ANDROID_HOME = C:UsersHalimAppDataLocalAndroidSdk
ANDROID_SDK_ROOT = %ANDROID_HOME%ools
JAVA_HOME = C:Program FilesJavajdk-13.0.1

and this is the path on my Windows 10

%USERPROFILE%AppDataLocalMicrosoftWindowsApps
C:UsersHalimAppDataLocalProgramsMicrosoft VS Codein
C:UsersHalimAppDataRoaming
pm
%ANDROID_HOME%platform-tools
%ANDROID_SDK_ROOT%in
%ANDROID_HOME%ools
C:Program Files
odejs
%JAVA_HOME%in
C:xamppphp
C:flutterin
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try to use java 1.8 instead of 13.0.1, that might solve your problem.

This error is similiar to this one:

Flutter A newer version of the Android SDK is required. To update, run: error?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...