颤振医生 --android-licenses 显示错误消息
Posted
技术标签:
【中文标题】颤振医生 --android-licenses 显示错误消息【英文标题】:flutter doctor --android-licenses shows error message 【发布时间】:2021-08-12 10:58:49 【问题描述】:如何解决此错误我在上面展示了许多视频,但无法正常工作。 我也尝试过 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
enter image description here
【问题讨论】:
确保在设置的环境变量中输入java的路径变量 【参考方案1】:你试过运行这个吗?
flutter doctor --android-licenses
【讨论】:
是的,我试过了,但它在线程“main”java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema 中显示异常【参考方案2】:首先,检查你是否有旧的JDK版本,例如
-
JDK 1.8.0_301
Java SE 开发工具包 8u202
从这里下载 JDK JDK 8 versions 正确选择您的系统信息 [位]。
使用旧版本将无缝运行 Flutter 和 Xamarin 应用程序 或者,如果您已经安装了 JDK@Latest,请尝试将它们降级到旧版本。
【讨论】:
以上是关于颤振医生 --android-licenses 显示错误消息的主要内容,如果未能解决你的问题,请参考以下文章
当我尝试运行颤振医生 --android-licenses 时出错
颤振医生 --android-licenses 显示错误消息
颤振医生 --android-licenses 给出一个 java 错误
颤振医生 --android-licenses 错误,如何解决这个问题?