Android license status unknown.

问题:

最近升级flutter到2.06,Android升级到4.2.1然后flutter doctor时报错:

Android license status unknown.
截屏2021-06-22 10.18.57.png

一看到这个报错:之间输入命令

flutter doctor --android-licenses

但是又报错

Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
    at com.android.repository.api.SchemaModule$SchemaModuleVersion.(SchemaModule.java:156)
    at com.android.repository.api.SchemaModule.(SchemaModule.java:75)
    at com.android.sdklib.repository.AndroidSdkHandler.(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)
    ... 5 more
截屏2021-06-22 10.15.32.png

最后查找资料,原来是要设置:
在android studio -> Android Sdk -> sdk tools -> Android sdk Command-line tools 勾选 然后点击 apply安装


截屏2021-06-22 10.21.00.png

截屏2021-06-22 10.21.14.png

你可能感兴趣的:(Android license status unknown.)