Failed to Install Android-Sdk: "Java.Lang.Noclassdeffounderror: Javax/Xml/Bind/Annotation/Xmlschema"

Failed to install android-sdk: java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema

I had a similar problem this morning (trying to build for Android using Unity3D). I ended up uninstalling JDK9 and installing Java SE Development Kit 8u144. Hope this helps.

  1. brew cask uninstall java # uninstall java9
  2. brew tap homebrew/cask-versions
  3. brew cask install java8 # install java8
  4. touch ~/.android/repositories.cfg # without this file, error will occur on next step
  5. brew install --cask android-sdk

java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema when accepting SDK licenses

You are using the wrong sdkmanager, tools directory has been deprecated

Open Android Studio and install the latest command-line tools:

Sample Image

This will create this folder in your Android SDK:

...\Android\Sdk\cmdline-tools\latest\bin

Now use the sdkmanager which is inside the bin directory to accept all the licenses:

C:\Users\jaspe\AppData\Local\Android\Sdk\cmdline-tools\latest\bin>sdkmanager.bat --licenses

Fix sdkmanager java.lang.NoClassDefFoundError batchfile

You can try this solution

First open sdkmanager.bat with any text editor

Then find this line

  %JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %SDKMANAGER_OPTS%

And change it to this line

  %JAVA_EXE%" %DEFAULT_JVM_OPTS% --add-modules java.xml.bind %JAVA_OPTS% %SDKMANAGER_OPTS%

I hope this solves your problem.

Not able to accept Android sdk licences 2020

The solution that worked is by forcefully downgrading jdk version to 8 from my current version 14, then repeating the same steps as above.

Exception in thread main java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema

I downgraded to Java 8 and it worked.

Don't know why 15 doesn't work in this case.



Related Topics



Leave a reply



Submit