Skip to content
Advertisement

How I can fix Android license status unknown in flutter?

When I run flutter doctor to check if everything is good I find this problem ” Android license status unknown. Run flutter doctor --android-licenses to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.”, and when I run flutter doctor --android-licenses previously is show up Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException at com.android.repository.api.RemoteListSourceProvider.create(RemoteListSourceProvider.java:51) at com.android.sdklib.repository.AndroidSdkHandler$RepoConfig.<init>(AndroidSdkHandler.java:626) at com.android.sdklib.repository.AndroidSdkHandler.getRepoConfig(AndroidSdkHandler.java:572) at com.android.sdklib.repository.AndroidSdkHandler.getSdkManager(AndroidSdkHandler.java:295) at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.setSdkHandler(SdkManagerCliSettings.java:101) at com.android.sdklib.tool.sdkmanager.SdkManagerCli.<init>(SdkManagerCli.java:95) at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:74) at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48) Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ... 8 more

but after I use this command JAVA_OPTS=-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee ,this what I get Error: Could not find or load main class '-XX:+IgnoreUnrecognizedVMOptions Caused by: java.lang.ClassNotFoundException: '-XX:+IgnoreUnrecognizedVMOptions

How I can fix all of these problems?

NOTE: Android SDK Tools (Obsolete) 26.1.1 is installed on my android studio

Advertisement

Answer

try updating your jdk version to the latest and setting jdk path again. also, set JAVA_HOME and make sure build gradle is completed successfuly in android studio. update sdk tools to the latest version and try again.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement