Hello Guys, How are you all? Hope You all Are Fine. Today I am just try to run flutter doctor –android-licenses this command And I am facing following error Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema Flutter in flutter. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
How Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema Flutter Error Occurs?
I am just try to run flutter doctor –android-licenses this command And I am facing following error.
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:521)
... 5 more
How To Solve Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema Flutter Error ?
- How To Solve Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema Flutter Error ?
To Solve Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema Flutter Error Install Android SDK Command-line Tools Open SDK Manager Top Menu -> Tools -> SDK Manager Install command-line tools Unfold Appearance & Behavior Unfold System Settings Click Android SDK Click tab of SDK Tools Check Android SDK Command-line Tools (latest). Click OK and Android Studio can install it.
- Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema Flutter
To Solve Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema Flutter Error Install Android SDK Command-line Tools Open SDK Manager Top Menu -> Tools -> SDK Manager Install command-line tools Unfold Appearance & Behavior Unfold System Settings Click Android SDK Click tab of SDK Tools Check Android SDK Command-line Tools (latest). Click OK and Android Studio can install it.
Solution 1 : Install Android SDK Command-line tools
Just Install Android SDK Command-line tools from Android SDK Manager is solved my error.
- Open Tools > SDK Manager
- From the left choose, Appearance & Behavior > System Settings > Android SDK
- Select SDK Tools from the top menu
- Check Android SDK Command-line tools and click ‘apply’.

After Android Studio completed the installation, you can accept the licenses as expected:
flutter doctor --android-licenses
After choosing “yes” for all licenses, the android licenses are accepted. To confirm:
flutter doctor -v
Solution 2 : let flutter automatically detects android studio path
Here I am recommending clearing the android-studio-dir and android-sdk settings, and let flutter automatically detects their path instead: This works for me .
flutter config --android-studio-dir=""
flutter config --android-sdk=""
Solution 3: Install Android SDK in Android Studio
- Install Android SDK Command-line Tools
- Open SDK Manager
- Top Menu -> Tools -> SDK Manager
- Install command-line tools
- Unfold Appearance & Behavior
- Unfold System Settings
- Click Android SDK
- Click tab of SDK Tools
- Check Android SDK Command-line Tools (latest).
- Click OK and Android Studio can install it.
Summary
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also, Read
- java.lang.IllegalArgumentException: Component class com.google.android.gms.wallet.ocr.CardRecognitionShimProxyActivity
- xcodebuild: WARNING: Using the first of multiple matching destinations
- Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema in flutter
- cmdline-tools component is missing Error in Flutter
- expanded widgets must be placed inside flex widgets
Leave a Reply