Flutter医生 –android-licenses问题

huangapple go评论91阅读模式
英文:

Flutter doctor --android-licenses problem

问题

希望你们都过得好。
我尝试在Flutter控制台中运行这个命令:

   flutter doctor --android-licenses

以下是错误信息:

异常线程“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)
造成原因: 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:521)
        ... 5 more

我进行了大量搜索,但没有找到解决方法。
有人可以帮帮我吗?

英文:

hope you guys doing well.
I was trying to run this command in flutter console:

   flutter doctor --android-licenses

here is the error:

Exception in thread &quot;main&quot; java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
        at com.android.repository.api.SchemaModule$SchemaModuleVersion.&lt;init&gt;(SchemaModule.java:156)
        at com.android.repository.api.SchemaModule.&lt;init&gt;(SchemaModule.java:75)
        at com.android.sdklib.repository.AndroidSdkHandler.&lt;clinit&gt;(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:521)
        ... 5 more

I searched a lot but I did not find out the solution.
Can someone please help me?

答案1

得分: 4

你需要安装Android SDK命令行工具,请注意您需要确保已安装Java JDK。

Flutter医生 –android-licenses问题

英文:

You need to install Android SDK Command-line tools, note you need to ensure you are having JavaJDK installed as well.

Flutter医生 –android-licenses问题

答案2

得分: 0

我实际上找到了一个部分解决方案。
我打开了 sdkmanager,然后修改了这一行:

set DEFAULT_JVM_OPTS=" -Dcom.android.sdklib.toolsdir=%~dp0.."

为了这样:

set DEFAULT_JVM_OPTS=" -Dcom.android.sdklib.toolsdir=%~dp0.." -XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee

我还将执行 sdkmanager 的部分修改为了这样:

"%JAVA_EXE%" %DEFAULT_JVM_OPTS% -XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee %JAVA_OPTS% %SDKMANAGER_OPTS% -classpath "%CLASSPATH%" com.android.sdklib.tool.sdkmanager.SdkManagerCli %CMD_LINE_ARGS%

但是仍然没有工作。以下是错误信息:

在引导层初始化期间发生错误
java.lang.module.FindException:找不到模块 java.se.ee
英文:

I actually find a half solution.
I opened sdkmanager and then changed this line:

set DEFAULT_JVM_OPTS=&quot;-Dcom.android.sdklib.toolsdir=%~dp0..&quot;

to this:

set DEFAULT_JVM_OPTS=&quot;-Dcom.android.sdklib.toolsdir=%~dp0..&quot; -XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee

and I also changed Execute sdkmanager to this:

&quot;%JAVA_EXE%&quot; %DEFAULT_JVM_OPTS% -XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee %JAVA_OPTS% %SDKMANAGER_OPTS% -classpath &quot;%CLASSPATH%&quot; com.android.sdklib.tool.sdkmanager.SdkManagerCli %CMD_LINE_ARGS%

but still it is not working.
here is the error:

Error occurred during initialization of boot layer
java.lang.module.FindException: Module java.se.ee not found

huangapple
  • 本文由 发表于 2020年10月5日 00:00:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/64196865.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定