Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Android loading plugin "dlopen failed: "
Forum Updated to NodeBB v4.3 + New Features

Android loading plugin "dlopen failed: "

Scheduled Pinned Locked Moved Solved Mobile and Embedded
5 Posts 2 Posters 893 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kofr
    wrote on 19 Jan 2024, 14:38 last edited by
    #1

    I am trying to add MapLibre to the Qt 6.6.1 Android project. Android can not dlopen plugin during the app launch.

    W ru.ubego.debug: Accessing hidden method Landroid/graphics/drawable/StateListDrawable;->getStateCount()I (light greylist, linking)
    E AndroidRuntime: FATAL EXCEPTION: qtMainLoopThread
    E AndroidRuntime: Process: ru.ubego.debug, PID: 3895
    E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "/home/dev/dev/prj/ubego-mobile-app/build-ubego-Android_Qt_6_6_1_Clang_arm64_v8a-Debug/libs/arm64-v8a/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_arm64-v8a.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$4.run(QtNative.java:311)
    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)
    

    what I add to qmake

    INCLUDEPATH *= \
            $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_libsrc/core/include/ \
    
    LIBS *= $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib//install/lib/libQMapLibre_$${ARCH}.so \
    $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibreLocation_$${ARCH}.so \
    $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_$${ARCH}.so \
    
    ANDROID_EXTRA_LIBS +=  $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibre_$${ARCH}.so \
    $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibreLocation_$${ARCH}.so \
    
    
    ANDROID_EXTRA_PLUGINS += $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins \
    

    So, I add libs to LIBS and ANDROID_EXTRA_LIBS. I add directory with the plugin itself to ANDROID_EXTRA_PLUGINS.
    Does anybody have ideas?

    J 1 Reply Last reply 19 Jan 2024, 14:50
    0
    • K Kofr
      19 Jan 2024, 14:38

      I am trying to add MapLibre to the Qt 6.6.1 Android project. Android can not dlopen plugin during the app launch.

      W ru.ubego.debug: Accessing hidden method Landroid/graphics/drawable/StateListDrawable;->getStateCount()I (light greylist, linking)
      E AndroidRuntime: FATAL EXCEPTION: qtMainLoopThread
      E AndroidRuntime: Process: ru.ubego.debug, PID: 3895
      E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "/home/dev/dev/prj/ubego-mobile-app/build-ubego-Android_Qt_6_6_1_Clang_arm64_v8a-Debug/libs/arm64-v8a/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_arm64-v8a.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$4.run(QtNative.java:311)
      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)
      

      what I add to qmake

      INCLUDEPATH *= \
              $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_libsrc/core/include/ \
      
      LIBS *= $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib//install/lib/libQMapLibre_$${ARCH}.so \
      $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibreLocation_$${ARCH}.so \
      $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_$${ARCH}.so \
      
      ANDROID_EXTRA_LIBS +=  $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibre_$${ARCH}.so \
      $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibreLocation_$${ARCH}.so \
      
      
      ANDROID_EXTRA_PLUGINS += $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins \
      

      So, I add libs to LIBS and ANDROID_EXTRA_LIBS. I add directory with the plugin itself to ANDROID_EXTRA_PLUGINS.
      Does anybody have ideas?

      J Offline
      J Offline
      JoeCFD
      wrote on 19 Jan 2024, 14:50 last edited by JoeCFD
      #3

      @Kofr add $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_$${ARCH}.so
      to ANDROID_EXTRA_LIBS as well. This is not a Qt plugin, but an extra one.

      ANDROID_EXTRA_LIBS +=  $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibre_$${ARCH}.so \
      $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibreLocation_$${ARCH}.so \
      $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_$${ARCH}.so \
      
      

      All Qt libs and plugins needed for Android will be wrapped automatically. All your own and third party libs and plugins have to be added to ANDROID_EXTRA_LIBS for deployment.

      K 1 Reply Last reply 19 Jan 2024, 15:08
      1
      • K Offline
        K Offline
        Kofr
        wrote on 19 Jan 2024, 14:46 last edited by
        #2

        The only thisng bothers me is why dlopen tryies to open the plugin with the linux host path.
        dlopen failed: library "/home/dev/dev/prj/ubego-mobile-app/build-ubego-Android_Qt_6_6_1_Clang_arm64_v8a-Debug/libs/arm64-v8a/maplibre_native_qt_lib/install/plugins/geoservices
        when the starts on the Android device

        1 Reply Last reply
        0
        • K Kofr
          19 Jan 2024, 14:38

          I am trying to add MapLibre to the Qt 6.6.1 Android project. Android can not dlopen plugin during the app launch.

          W ru.ubego.debug: Accessing hidden method Landroid/graphics/drawable/StateListDrawable;->getStateCount()I (light greylist, linking)
          E AndroidRuntime: FATAL EXCEPTION: qtMainLoopThread
          E AndroidRuntime: Process: ru.ubego.debug, PID: 3895
          E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "/home/dev/dev/prj/ubego-mobile-app/build-ubego-Android_Qt_6_6_1_Clang_arm64_v8a-Debug/libs/arm64-v8a/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_arm64-v8a.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$4.run(QtNative.java:311)
          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)
          

          what I add to qmake

          INCLUDEPATH *= \
                  $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_libsrc/core/include/ \
          
          LIBS *= $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib//install/lib/libQMapLibre_$${ARCH}.so \
          $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibreLocation_$${ARCH}.so \
          $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_$${ARCH}.so \
          
          ANDROID_EXTRA_LIBS +=  $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibre_$${ARCH}.so \
          $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibreLocation_$${ARCH}.so \
          
          
          ANDROID_EXTRA_PLUGINS += $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins \
          

          So, I add libs to LIBS and ANDROID_EXTRA_LIBS. I add directory with the plugin itself to ANDROID_EXTRA_PLUGINS.
          Does anybody have ideas?

          J Offline
          J Offline
          JoeCFD
          wrote on 19 Jan 2024, 14:50 last edited by JoeCFD
          #3

          @Kofr add $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_$${ARCH}.so
          to ANDROID_EXTRA_LIBS as well. This is not a Qt plugin, but an extra one.

          ANDROID_EXTRA_LIBS +=  $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibre_$${ARCH}.so \
          $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibreLocation_$${ARCH}.so \
          $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_$${ARCH}.so \
          
          

          All Qt libs and plugins needed for Android will be wrapped automatically. All your own and third party libs and plugins have to be added to ANDROID_EXTRA_LIBS for deployment.

          K 1 Reply Last reply 19 Jan 2024, 15:08
          1
          • J JoeCFD
            19 Jan 2024, 14:50

            @Kofr add $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_$${ARCH}.so
            to ANDROID_EXTRA_LIBS as well. This is not a Qt plugin, but an extra one.

            ANDROID_EXTRA_LIBS +=  $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibre_$${ARCH}.so \
            $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibreLocation_$${ARCH}.so \
            $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_$${ARCH}.so \
            
            

            All Qt libs and plugins needed for Android will be wrapped automatically. All your own and third party libs and plugins have to be added to ANDROID_EXTRA_LIBS for deployment.

            K Offline
            K Offline
            Kofr
            wrote on 19 Jan 2024, 15:08 last edited by
            #4

            @JoeCFD Thank you for reply. It works.
            However during the startup QML can not resolve
            : qrc:/XPage.qml:4 module "QtLocation.MapLibre" is not installed

            on desktop it worked when I add a path to the plugin to library path, QCoreApplication::addLibraryPath("/home/prj/maplibre-native-qt/install/plugins/");
            but how it works on Android?
            Documentation is poor about this.

            J 1 Reply Last reply 19 Jan 2024, 15:20
            0
            • K Kofr
              19 Jan 2024, 15:08

              @JoeCFD Thank you for reply. It works.
              However during the startup QML can not resolve
              : qrc:/XPage.qml:4 module "QtLocation.MapLibre" is not installed

              on desktop it worked when I add a path to the plugin to library path, QCoreApplication::addLibraryPath("/home/prj/maplibre-native-qt/install/plugins/");
              but how it works on Android?
              Documentation is poor about this.

              J Offline
              J Offline
              JoeCFD
              wrote on 19 Jan 2024, 15:20 last edited by JoeCFD
              #5

              @Kofr Plugins are .so libs as well. Simply add all needed ones to your build in the same way. They are extra libs too.

              1 Reply Last reply
              0
              • K Kofr has marked this topic as solved on 19 Jan 2024, 15:56

              1/5

              19 Jan 2024, 14:38

              • Login

              • Login or register to search.
              1 out of 5
              • First post
                1/5
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved