How to solve error : You have not Accepted the License Agreements in Flutter (2023)

In this article, I will share with you easy steps on how to solve error You have not accepted the license agreements in a flutter. Let's see the below steps.

Error:

You may have seen this error as something like the one below.

hari@hpc:~/flutter_sdk$ 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:522)

 

Solution:

- The first step is open Android Studio and go to SDK Manager.

- The second step is select SDK Tools.

Check "Android SDK Command - Line Tools", and press Apply button. 

In the last step, SDK Manager will install "Android SDK Command-line Tools", after installing it, in the terminal run the command below to accept the Android SDK license. 

 

flutter doctor --android-licenses

 

After accepting all the SKD licenses, run the flutter doctor command in the terminal like below.

 flutter doctor

 

Conclusion:

In this article, we saw step-by-step How to solve error: You have not accepted the license agreements in the flutter. I hope this article may help you.

Tags: