leo-boy
leo-boy

Reputation: 77

Android license status unknown?

For app development I download and installed Flutter sdk along with its dependencies Android studio, Java. After installing all I came to an error for checking flutter doctor. The following error came:

    Android toolchain - develop for Android devices (Android SDK version 28.0.3)
        X Android license status unknown.
          Try re-installing or updating your Android SDK Manager.
          See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed instructions.

Then after searching with the help of Flutter Android license status unknown I tried to update Android SDK with PathToAndroidSDK --update It again generates 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:583)
            at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
            at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
            ... 5 more

Upvotes: 1

Views: 4079

Answers (3)

Samuel Bi&#233;
Samuel Bi&#233;

Reputation: 900

After a long night i figured out that i have installed a bad Java version.

I solved this installing JDK 8, correctly and setting the jdk path on android studio.

After that

flutter doctor --android-licenses

Of course the obsolete tools should be installed too

Hope it helps. To some one reaching here.

Upvotes: 1

Anant Mundhra
Anant Mundhra

Reputation: 11

Finally, I got the solution how to fix Android licenses status unknown

Firstly, if you are watching this error

Android toolchain - develop for Android devices (Android SDK version 28.0.3) X Android license status unknown. Try re-installing or updating your Android SDK Manager. See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed instructions.

then go and uninstall "Android sdk tool" and "Obsolete" and reinstall. Then, run the code "flutter doctor" You will see some like this "If some licenses are not accepted then accept by using "flutter doctor --android-licenses"

Then run the code if you got stuck and not be able to reply "y" then goto this link and download Command line tools onlyand extract it and put sdkmanager file in C:\Users\i\AppData\Local\Android\Sdk\tools\bin and run cmd in this folder and type "sdkmanager --licenses" and now you are good to go.

Upvotes: 1

Raams
Raams

Reputation: 177

Refer : https://robbinespu.gitlab.io/blog/2020/03/02/flutter-issue-android-license-status-unknown-on-windows/

In Android Studio -> Tools -> SDK Manager -> Android SDK -> SDK Tools 1. Uncheck the "Hide Obsolete Packages" 2. Select Android SDK Tools(Obsolete) and Apply

After the installation try "flutter doctor" from command prompt. If some licenses are not accepted then accept by using "flutter doctor --android-licenses"

Upvotes: 1

Related Questions