flatter-doctor-android许可证:线程“main”java.lang.noclassdeffounderror中出现异常

hgqdbh6s  于 2021-07-09  发布在  Java
关注(0)|答案(2)|浏览(336)

我试图安装Flutter,但它不会让我接受android许可证。我得到以下错误:

PS C:\Users\XXXX> 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: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

我已经从这里卸载了我的当前版本的java,并干净地安装了java8。
这是什么 flutter doctor 退货:

[✓] Flutter (Channel stable, 1.22.3, on Microsoft Windows [Version 10.0.18363.1139], locale en-IE)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[!] Android Studio (version 4.1.0)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.50.1)
[!] Connected device
    ! No devices available
sauutmhj

sauutmhj1#

从androidsdkmanager安装androidsdk命令行工具帮了我的忙。
打开android studio
工具>sdk管理器
从左侧选择“外观和行为”>“系统设置”>“android sdk”
从顶部菜单中选择sdk工具
检查androidsdk命令行工具并单击apply。

jdzmm42g

jdzmm42g2#

我也有同样的问题。
只要安装androidstudio,问题就解决了。

相关问题