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. Dependency issue using standard library (.so file) that depends on QT packages in native Android application.
Forum Updated to NodeBB v4.3 + New Features

Dependency issue using standard library (.so file) that depends on QT packages in native Android application.

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 3 Posters 1.6k 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.
  • tenthhouseT Offline
    tenthhouseT Offline
    tenthhouse
    wrote on last edited by
    #1

    I am using Android Studio to develop a native Android application. I am interested in utilizing a set of APIs provided by a third party (these APIs are provided as a '.so' and affiliated 'h' file). However, these APIs have been developed on QT Creator and have various QT dependencies. As these APIs are in C++, I am using a NDK to manage this third party library.

    As I am new to using NDK, I am extending this Github project, which demonstrates how to manage 3P party C/C++ libraries in Android Studio, to incorporate the additional 3P APIs contained in a .so file provided to me.

    I used the 3P provided .so file in the same way as gperf is used in the above Github project. However, I ran into the following error:

    03-18 13:08:59.210 12948 12948 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "libQt5OpenGL.so" not found: needed by /data/app/~~pW_8vzM6r5D_AQNwXKMKkw==/com.example.hellolibs-K3tiF92oRwA3H4cb2FAb-A==/lib/arm64/liblisten.so in namespace classloader-namespace

    After adding libQt5OpenGL.so to the newapi/lib/arm64-v8a, newapi/lib/armeabi-v7a, newapi/lib/x86, and newapi/lib/x86_64 folders, I was missing libQt5Multimedia.so. I continued add libQt5*.so files to these folders until my app was able to run.

    Now, when my app runs, it immediately crashes and I see this error:

    04-02 23:05:01.528 3805 3805 F ample.hellolib: java_vm_ext.cc:577] JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called with pending exception java.lang.ClassNotFoundException: Didn't find class "org.qtproject.qt5.android.extras.QtNative" on path: DexPathList[[zip file "/data/app/~~zwBplIzpPfk_OXPn9sHXFQ==/com.example.hellolibs-rMNBz4SC14NhfaNS97A7bg==/base.apk"],nativeLibraryDirectories=[/data/app/~~zwBplIzpPfk_OXPn9sHXFQ==/com.example.hellolibs-rMNBz4SC14NhfaNS97A7bg==/lib/arm64, /data/app/~~zwBplIzpPfk_OXPn9sHXFQ==/com.example.hellolibs-rMNBz4SC14NhfaNS97A7bg==/base.apk!/lib/arm64-v8a, /system/lib64, /system/system_ext/lib64, /system/product/lib64]]

    Not sure what next steps I can take to successfully import this .so file. Any guidance would be very much appreciated. And/or any examples of third party libraries that use QT that have been successfully used in a Native Android app through Android Studio would be great to go off of. :)

    1 Reply Last reply
    1
    • M Offline
      M Offline
      morsch
      wrote on last edited by
      #2

      I feel like this is a Bug and i have the same Problem. Maybe you can Vote for this Bug: https://bugreports.qt.io/browse/QTBUG-84371
      It has the same missing QtNative Library error.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        morsch
        wrote on last edited by
        #3

        I found a Solution: In the Installation Directory is the Folder /<Version>/android/jar/. In there are all the Libraries you need like QtAndroidExtras in your case. You can copy them in your android project and set the dependencies and it should load.

        S 1 Reply Last reply
        1
        • M morsch

          I found a Solution: In the Installation Directory is the Folder /<Version>/android/jar/. In there are all the Libraries you need like QtAndroidExtras in your case. You can copy them in your android project and set the dependencies and it should load.

          S Offline
          S Offline
          software.dev992
          wrote on last edited by
          #4

          @morsch Great! I had the same issue and your solution solved it! Thanks!!

          1 Reply Last reply
          0

          • Login

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