0

I use the command line to develop Android apps, so I need to use the command line SDK tools. Whenever I run sdkmanager.bat or avdmanager.bat from the command line, I always get this 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.AvdManagerCli.run(AvdManagerCli.java:213)
    at com.android.sdklib.tool.AvdManagerCli.main(AvdManagerCli.java:200)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
    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 have seen in many posts that these tools need Java 8 and that's what causing the error. I had also tried the tweaks to the sdkmanager.bat file mentioned in those posts, but then I get java.se.ee module not found.
So, I need to manually install the required tools such as the platform tools and system images directly from the actual website without using the sdkmanager. Can anyone help me on how to do this?

The post at How to install Android SDK Build Tools on the command line? didn't help me in any way.

Puspam
  • 2,137
  • 2
  • 12
  • 35
  • 1
    Does this help you? https://developer.android.com/studio/command-line – Pronoy999 Jan 23 '20 at 05:28
  • Does this answer your question? [How to install Android SDK Build Tools on the command line?](https://stackoverflow.com/questions/17963508/how-to-install-android-sdk-build-tools-on-the-command-line) – Pronoy999 Jan 23 '20 at 05:29
  • "I always get an error." Don't make us guess. What error message did you get? – Stephan Branczyk Jan 23 '20 at 15:51
  • @Pronoy999 the website that you mentioned does not include how to download system images and creating emulators. – Puspam Jan 23 '20 at 16:24
  • How does Android Studio do these things without using the `sdkmanager` or `avdmanager` tools? Maybe I can do something like that. – Puspam Jan 23 '20 at 16:26
  • @Puspam Check out this link. https://developer.android.com/studio/command-line/avdmanager – Pronoy999 Jan 24 '20 at 05:25
  • I had already seen that, but I am asking how to do these things without the sdkmanager and avdmanager tools because as I have mentioned in my question, they don't work for me. – Puspam Jan 24 '20 at 09:59

0 Answers0