Important: Please read the Qt Code of Conduct -

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

  • 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 "" not found: needed by /data/app/~~pW_8vzM6r5D_AQNwXKMKkw==/com.example.hellolibs-K3tiF92oRwA3H4cb2FAb-A==/lib/arm64/ in namespace classloader-namespace

    After adding to the newapi/lib/arm64-v8a, newapi/lib/armeabi-v7a, newapi/lib/x86, and newapi/lib/x86_64 folders, I was missing 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:] JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called with pending exception java.lang.ClassNotFoundException: Didn't find class "" 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. :)

  • I feel like this is a Bug and i have the same Problem. Maybe you can Vote for this Bug:
    It has the same missing QtNative Library error.

Log in to reply