简体   繁体   中英

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

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"

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 only and 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.

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.

Go to Android Studio and update the sdk tools and plugins.

Perform the following steps https://developer.android.com/studio/intro/update#sdk-manager

and run the flutter doctor

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM