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

Project with 2 modules (cmake) on Android return "java.lang.UnsatisfiedLinkError: dlopen failed: library "ld-android.so" not found" on second build / run on device

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 6.4.2, 6.5.0 Beta2
    • Build System: CMake
    • None
    • Windows / Linux
      Qt Creator 9.0.1
      Tested build for armv7a/arm64_v8a

      More info from mac:
      CMake: 3.25.2
      NDK: 25.1.8937393
      Host CPU: ARM M1
    • Android, macOS, Windows
    • 1e81f206b (11.0)
    • Next

    Description

      Creating a CMake project with 2 modules (lets say main module as UI and second as backend will fail on Android second run if the build directory is not cleaned.
      Cleaning the build directory will run application correctly on device.
      Adding manual STATIC to qt6_add_qml_module is fixing the issue, but letting it empty or setting it SHARED is confirming the issue.
      I tested on the latest QtCreaor available on mac and window with NDK 23 and 25

      Attached is a working code which can be opened on QtCreator.
      Open it, run.
      Will run the app (just a blank window)
      Run it again (build and run to be specified) and the following error is raised:

      W System  : ClassLoader referenced unknown path:
      W DesignStudioAp: Accessing hidden method Landroid/content/ContextWrapper;->getDisplay()Landroid/view/Display; (light greylist, linking)
      I DecorView: createDecorCaptionView >> DecorView@54a57c[], isFloating: false, isApplication: true, hasWindowDecorCaption: false, hasWindowControllerCallback: true
      D OpenGLRenderer: Skia GL Pipeline
      E AndroidRuntime: FATAL EXCEPTION: qtMainLoopThread
      E AndroidRuntime: Process: org.qtproject.example.QtDesignStudioApp, PID: 27417
      E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "ld-android.so" not found
      E AndroidRuntime: 	at java.lang.Runtime.load0(Runtime.java:928)
      E AndroidRuntime: 	at java.lang.System.load(System.java:1633)
      E AndroidRuntime: 	at org.qtproject.qt.android.QtNative$2.run(QtNative.java:432)
      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:764)
      I Process : Sending signal. PID: 27417 SIG: 9 

      Attachments

        Issue Links

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

          Activity

            People

              semlanik Alexey Edelev
              cmgeorge George Calugar
              Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes