Hello Guys How are you all? Hope You all are fine. I am trying to run flutter doctor and flutter doctor saying to accept license when I ran flutter doctor –android-licenses it gives a java error in a flutter. So today Here I come with all possible solutions for this error.
We are providing you all possible solutions to solve this error. let’s start this article without wasting your time.
How flutter doctor –android-licenses gives a java error ?
I am trying to run flutter doctor and flutter doctor saying to accept license when I ran flutter doctor –android-licenses it gives a java error in a flutter.
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
... 5 more
How to Solve flutter doctor –android-licenses gives a java error?
Question: How to Solve flutter doctor –android-licenses gives a java error?
Answer: To solve this issue Just Install Android SDK Command-line tools from Android SDK Manager is solved my error. This solution is worked for me. 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’.
Just Install Android SDK Command-line tools from Android SDK Manager is solved my error. This solution is worked for me.
- 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
I recommend 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=""
1. 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.
So, It’s All About This Error. I hope this tutorial helps you solve your error. Please Comment Below if You stucks anywhere with my code.
Also Check Out Below Tutorials
- How to make a blur Background Image effect in Flutter using BackdropFilter.
- Create Rounded Corners Image in Flutter.
- set Background Image to Scaffold in Flutter.
- How To Select multiple images with Flutter
- How to Set Network Image In Circular Avatar In Flutter?