Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-85866

"Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema" when following Qt for Android build docs on Linux

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.15
    • Fix Version/s: 5.15.2
    • Component/s: Documentation, QPA
    • Labels:
      None
    • Environment:
      Linux 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
    • Platform/s:
      Android
    • Commits:
      6ab3f6199bd74726143efa0db4a697d7d9fda460

      Description

      I'm following https://doc.qt.io/qt-5/android-building.html#using-the-package-manager. When running sdkmanager --verbose --licenses, I get this output:

      mitch@mitch-ubuntu-18:/media/dev2$ ./Android/Sdk/tools/bin/sdkmanager  --verbose --licenses
      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:581)
              at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
              at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
      

      The comments of QTCREATORBUG-21612 say that https://stackoverflow.com/questions/47345147/android-sdk-manager-throw-exception-with-java-9 fixes this error, but comments on that answer say that it no longer does.

      Similarly, comments on this answer say that the workaround no longer works with JDK 11:

      https://stackoverflow.com/a/50604833

      So I'm unable to build Qt for Android on Linux.

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              assam Assam Boudjelthia
              Reporter:
              mitch_curtis Mitch Curtis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes