英文:
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 "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: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。
英文:
You need to install Android SDK Command-line tools
, note you need to ensure you are having JavaJDK installed as well.
答案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="-Dcom.android.sdklib.toolsdir=%~dp0.."
to this:
set DEFAULT_JVM_OPTS="-Dcom.android.sdklib.toolsdir=%~dp0.." -XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee
and I also changed Execute sdkmanager to this:
"%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%
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论