安装android sdk工具时,会发出以下错误:
JAVAlang.NoClassDefFoundError:javax/xml/bind/annotation/XmlSchema
为什么会发生这种情况?如何解决?
调试输出:
$ java --version
java 9
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)
$ brew cask install android-sdk
==> Caveats
We will install android-sdk-tools, platform-tools, and build-tools for you.
You can control android sdk packages via the sdkmanager command.
You may want to add to your profile:
'export ANDROID_SDK_ROOT=/usr/local/share/android-sdk'
This operation may take up to 10 minutes depending on your internet connection.
Please, be patient.
==> Satisfying dependencies
==> Downloading https://dl.google.com/android/repository/sdk-tools-darwin-3859397.zip
Already downloaded: /Users/tomasnovella/Library/Caches/Homebrew/Cask/android-sdk--3859397,26.0.1.zip
==> Verifying checksum for Cask android-sdk
==> Installing Cask android-sdk
==> 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.SdkManagerCli.main(SdkManagerCli.java:117)
==> at com.android.sdklib.tool.SdkManagerCli.main(SdkManagerCli.java:93)
==> Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
==> at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
==> at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
==> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
==> ... 5 more
Error: Command failed to execute!
==> Failed command:
/usr/local/Caskroom/android-sdk/3859397,26.0.1/tools/bin/sdkmanager tools platform-tools build-tools;26.0.1
==> Standard Output of failed command:
==> Standard Error of failed command:
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.SdkManagerCli.main(SdkManagerCli.java:117)
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:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
... 5 more
Java8
,打开android studio
输入命令
flatter-doctor
输入命令
flatter doctor--android许可证
并通过键入
y
接受所有许可证
今天早上我遇到了类似的问题(尝试使用Unity3D为Android构建)。我最终卸载了JDK9并安装了JavaSE开发工具包8u144。希望这有帮助。
brew cask卸载java
#卸载java9brew点击自制/cask版本
brew cask安装java8
#安装java8touch~/。android/存储库。cfg
#如果没有此文件,下一步将发生错误brew cask安装android sdk
刚刚出现了这个错误,通过在Android Studio上的首选项下下载
Android SDK命令行工具(最新版本)
解决了这个问题
最后,在您的
. bashrc
,. zshirc
或类似文件中,在过时的工具之前,将新工具添加到您的PATH中:
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
问题内容: 安装android sdk工具时,会发出以下错误: java.lang.NoClassDefFoundError:javax / xml / bind / annotation / XmlSchema 为什么会发生这种情况,如何解决? 调试输出: 问题答案: 今天早上,我遇到了类似的问题(试图使用Unity3D为Android构建)。我最终卸载了JDK9并安装了Java SE Deve
There are some steps you must follow before you can build and run any code on your Android device. This is true regardless of whether you use Unity or write Android applications from scratch. 想要你的代码能够
我不能在android studio cpu中安装haxm:AMD Phenom x6 1100T 安装Intel HAXM失败。有关详细信息,请查看安装日志:HAXM安装失败。要安装HAXM,请按照以下位置的说明安装:https://software.intel.com/android/articles/installation-instructions-for-intel-hardware-a
是否卸载现有应用程序? 我尝试在另外5个示例程序上这样做,但所有这些程序都给出了这个错误。有人知道怎么解决这个吗?
当我试图在模拟器上运行android应用程序时,我一次又一次地收到这个错误消息。 安装失败,并显示消息Invalid File:F:\ PSL 2.0 \ app \ build \ intermediates \ split-apk \ debug \ slices \ slice _ 4 . apk。通过卸载现有版本的apk(如果存在),然后重新安装,可能会解决此问题。 警告:卸载将删除应用程
3.1.安装Android SDK Android软件开发包(SDK)是你开发Android应用所需的一切。除了一套开发的工具集,它也提供了一个用以测试的平台。你可以在Android SDK的下载页面为你的目标平台下载到对应的Android SDK。 下载之后,解压到一个方便访问的目录。在本书随后的例子中,将假定你的SDK安装目录在~/andorid-sdk。若你的安装目录在其它位置,留意替换即可