I'm trying to run the command flutter doctor --android-licenses to accept the SDK package license but I'm getting this message
C:\Users\Administrator\AndroidStudioProjects\flutter_app>flutter doctor --android-licenses
6 of 7 SDK package licenses not accepted. 100% Computing updates...
Review licenses that have not been accepted (y/N)?
When I tried to run the application
C:\Users\Administrator\AndroidStudioProjects\flutter_app>flutter run
Launching lib\main.dart on SM J610F in debug mode...
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 61.2s
Exception: Gradle task assembleDebug failed with exit code -1
I tried to run the command in cmd
C:\Users\Administrator\AppData\Local\Android\Sdk\tools\bin>sdkmanager.bat --licenses
but getting below 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:602)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 5 more
I am looking for a solution. Do you have any ideas?
Thanks!
When you run "flutter doctor --android-licenses to accept" but don´t receive the option to accept them, run 1) "flutter doctor --android-licenses -v" [ends in -v ] then 2) Run again "flutter doctor --android-licenses to accept" [no -v] Then you will have a chance to start accept options and just write "y" on all. 3) Run again flutter doctor This worked for me