Hello Guys How are you all? Hope You all are fine. When I Run flutter app I got a Flutter run error: You have not accepted the license agreements 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 run error: You have not accepted the license agreements Error Occurs ?
When I Run the flutter app I got a Flutter run error: You have not accepted the license agreements in a flutter. here is an error.
- What went wrong: A problem occurred configuring project ‘:shared_preferences’.
You have not accepted the license agreements of the following SDK components: [Android SDK Platform 27].
Here is my flutter doctor output.
[✓] Flutter (Channel beta, v0.4.4, on Linux, locale en_NG)
• Flutter version 0.4.4 at /home/user/Programs/flutter
• Framework revision f9bb4289e9 (5 weeks ago), 2018-05-11 21:44:54 -0700
• Engine revision 06afdfe54e
• Dart version 2.0.0-dev.54.0.flutter-46ab040e58
[!] Android toolchain - develop for Android devices (Android SDK 28.0.0)
• Android SDK at /home/user/Android/Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.0
• ANDROID_HOME = /home/user/Android/Sdk
• Java binary at: /opt/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_76-release-b03)
✗ Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
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</pre>
How to Solve Flutter run error: You have not accepted the license agreements Error?
- How to Solve Flutter run error: You have not accepted the license agreements Error?
To solve Flutter run error: You have not accepted the license agreements error you just have to accept an android license. Just apply all the below commands. Open your terminal type flutter doctor –android-licenses press y to accept every license. If You are facing a java error then just read our article flutter doctor –android-licenses gives a java error.
- Flutter run error: You have not accepted the license agreements
To solve Flutter run error: You have not accepted the license agreements error you just have to accept an android license. Just apply all the below commands. Open your terminal type flutter doctor –android-licenses press y to accept every license. If You are facing a java error then just read our article flutter doctor –android-licenses gives a java error.
Solution 1
You have to accept an android license. Just apply all the below commands.
- Open your terminal
- type
flutter doctor --android-licenses
- press
y
to accept every license.
If You are facing java error then just read our article flutter doctor –android-licenses gives a java 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
If you face above error then just follow below step.
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
Solution 2
If you are in windows open command prompt as admin and run the following command.
flutter doctor --android-licenses
Then enter y
for all (y/n) to accept agreement.
Solution 3
First make sure Android SDK is installed on your device. Also see if 2 Android SDK’s are not Installed!
Then just simply type on Terminal or CMD flutter doctor --android-licenses
Then press y
until it acquires all permissions.
Summery
So, It’s All About This Error. I hope this tutorial helps you to solve your error. Please Comment Below if You stucks anywhere with my code.
Also Check Out Below Tutorials
- How to Set Network Image In Circular Avatar In Flutter?
- How To Select multiple images with Flutter
- Also Read How to Create Dropdown Button In Flutter, Dropdown Lists in Flutter
- How To Store And Get Data From Shared Preferences in Flutter
- How to Display Current DateTime in Flutter