Solve Exception Error on ʺflutter doctor --android-licensesʺ Command

Are you have to hit Are you getting an exception error while you execute the command "flutter doctor --android-licenses". This command is necessary to accept the Android SDK license. See the example below to solve this issue on Flutter.

hari@hpc:~/flutter_sdk$ flutter doctor --android-licenses
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(
	at java.base/java.lang.ClassLoader.loadClass(

1. Open Android Studio, and go to SDK Manager.

2. Go to SDK Tools, and Check "Android SDK Command Line Tools", and Hit Apply.

Now, SDK Manager will install "Android SDK Command-line Tools", after installing, hit the command below to accept the Android SDK license. 

flutter doctor --android-licenses

After accepting all the SKD licenses, hit the flutter doctor command again.

In this way, you can solve the exception error on command "flutter doctor --android-licenses".

No any Comments on this Article

Please Wait...