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

UnsatisfiedLinkError on Android when using executables in cmake subprojects

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1: Critical P1: Critical
    • None
    • 6.4.3, 6.5.0, 6.5.1
    • Build System: CMake
    • None
    • Building on kubuntu 22.04, executing on a google pixel 6 with android 13
    • Android
    • 1e81f206b (11.0)

      I have a cmake project with an executable, and a subproject with a lib and an executable. Building and running both projects works on desktop. However, when i deploy and run the subproject executable, then i get a linker error:

       

      ```
      W System  : ClassLoader referenced unknown path:
      E AndroidRuntime: FATAL EXCEPTION: qtMainLoopThread
      E AndroidRuntime: Process: org.qtproject.example.submain, PID: 22663
      E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "ld-android.so" not found: needed by /data/app/~~i6Y9JhhM8OCX8kiyI8YlVA==/org.qtproject.example.submain-9r4QsCFypiSVpdmVkhKF1A==/lib/arm64/libc.so in namespace classloader-namespace
      E AndroidRuntime:     at java.lang.Runtime.load0(Runtime.java:929)
      E AndroidRuntime:     at java.lang.System.load(System.java:1625)
      E AndroidRuntime:     at org.qtproject.qt.android.QtNative$2.run(QtNative.java:229)
      E AndroidRuntime:     at org.qtproject.qt.android.QtThread$2.run(QtThread.java:51)
      E AndroidRuntime:     at org.qtproject.qt.android.QtThread$1.run(QtThread.java:25)
      E AndroidRuntime:     at java.lang.Thread.run(Thread.java:1012)
      ```

      I have attached a minimal example.

      It's also funny, that running the executable from the parent project works at first, but breaks with the same error after running the subproject.

        For Gerrit Dashboard: QTBUG-113851
        # Subject Branch Project Status CR V

            semlanik Alexey Edelev
            adamce Adam
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes