0

如何解决这个错误我在上面展示了很多视频,但那是行不通的。我也尝试过 JDK 8,但它不起作用。目前在 JDK 15 上运行。

安装java 15

**

颤振医生-v

**

[√] Flutter (Channel dev, 2.3.0-0.1.pre, on Microsoft Windows [Version 10.0.19042.928], locale en-IN)
    • Flutter version 2.3.0-0.1.pre at C:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d72bfb8d07 (4 weeks ago), 2021-04-26 06:05:55 -0700
    • Engine revision de6e1adf97
    • Dart version 2.14.0 (build 2.14.0-18.0.dev)

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\Savan Rajyaguru\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
    X 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.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.1.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)

[√] VS Code (version 1.56.0)
    • VS Code at C:\Users\Savan Rajyaguru\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (2 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.212
    • Edge (web)   • edge   • web-javascript • Microsoft Edge 90.0.818.66

! Doctor found issues in 1 category.

**

颤振医生--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: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

在此处输入图像描述

4

2 回答 2

0

你试过运行这个吗?

flutter doctor --android-licenses
于 2021-05-24T05:15:46.257 回答
0

首先,检查您是否有旧的 JDK 版本,例如

  1. JDK 1.8.0_301
  2. Java SE 开发工具包 8u202

从这里下载 JDK JDK 8 版本 正确选择您的系统信息 [位]。

使用旧版本将无缝运行 Flutter 和 Xamarin 应用程序,或者如果您已安装 JDK@Latest,请尝试将它们降级到旧版本。

于 2021-12-23T06:59:54.670 回答