processing-android icon indicating copy to clipboard operation
processing-android copied to clipboard

SDK Updater crahes with 'java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema' error

Open codeanticode opened this issue 4 years ago • 3 comments

Due to removal of Java EE modules in Java 11:

https://jaxenter.com/jdk-11-java-ee-modules-140674.html

This could be fixed by using new new Android SDK Command-line Tools For JVM 9, 10, 11, And Later:

https://www.dev2qa.com/how-to-fix-java-lang-noclassdeffounderror-javax-xml-bind-annotation-xmlschema-when-install-android-sdk/

codeanticode avatar Aug 18 '21 08:08 codeanticode

The sdklib package has new versions after the one currently in use (27.1.1)

https://mvnrepository.com/artifact/com.android.tools/sdklib?repo=google

but those probably need a newer version of gradle #661

codeanticode avatar Aug 18 '21 08:08 codeanticode

I confirm this issue, SDKDownload.java needs to be configured to download the latest command-line tools. Changing android-toolslib version to recent latest 30.1.3 showed some used methods have been replaced and removed. Here is a part of the errors after changing the version -

SDKUpdater.java:161: error: method getInstance in class AndroidSdkHandler cannot be applied to given types;
      AndroidSdkHandler mHandler = AndroidSdkHandler.getInstance(sdkFolder);
                                                    ^
  required: AndroidLocationsProvider,Path
  found: File
  reason: actual and formal argument lists differ in length
\SDKUpdater.java:164: error: cannot find symbol
      FileSystemFileOp fop = (FileSystemFileOp) FileOpUtils.create();
      ^
  symbol:   class FileSystemFileOp
  location: class SDKUpdater.QueryTask

Not sure, but does resolving this issue really depend on Gradle upgrade? @codeanticode

rupeshkumar22 avatar Apr 10 '22 02:04 rupeshkumar22

I don't think it depends on updating Gradle to a newer version, which was updated already to 7.x (#661)

codeanticode avatar Jun 26 '22 16:06 codeanticode