If you are here it means that you are facing a frustrating exception regarding Android licenses in Flutter.
More specifically the exception occurs when you try to run the following command:
$ flutter doctor --android-licenses
and the output is something like this:
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:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 5 more
The easiest fix I found is to install the Android SDK Command-line Tools.
In Android Studio open
File > Settings > Appearance & Behavior > System Settings > Android SDK > SDK Tools

then tick the corresponding element, install and restart Android Studio and everything shoul work like a charm.
Happy coding!


Thanks, This fixed the erro
Happy to help
thank you so much man!
You saved a lot of time of mine
You are welcome
Thank You so much. Fixed my issue
Much Appreciated
Thank you so much. It worked for me !
this is the best solution available over internet !!!!
Thank you very much
Yes thats work for me to
Thank you so much

I tried many solutions but just this solution worked.
You are welcome
Thanks!
You are a real help
Very Nice Edoardo
Good work
Thank you Mohsin!
Sensacional! A soluรงรฃo perfeita!
Thanks It worked for meโฆ..
Thank you so much!
Thanks! itโs worked for me!
Thanks a lot !
Thank you! Solved the problem for me!
Thanks It Worked.
Thanks a lot, you really save my time
Really simple and effective, many thanks!
Youโre welcome
Grazie mille!
Di niente!
thank you very very much
really you saved me at big problem
You are welcome
Thatโs awesome!!! Thanks
Superb! solved my problem
Thank you amadeo
Thank You!!
Hello there!
A mobile developer beginner here.
Please when you said โthen tick the corresponding elementโ what were you referring to?
Am I to tick all elements that are โNot Installedโ?
Iโll be glad to get a feedback from you.
Thank you.
Hello Emmanuel, as described here โThe easiest fix I found is to install the Android SDK Command-line Tools.โ you should select only the SDK command line tools
Happy coding and enjoy Flutter!
It worked, nice! Thanks!
Simple solutionโฆ.saved me time and stress