Using a Qt based library in an android app

  • Hi,

    i have a library which is based on Qt 5. I built it for armeabi to get a shared library.
    The Anroid application has an jni part which involves the Library. Therefore i have a folder "lib" in my project root. There the library is placed in armeabi/
    In the folder "jni" contained in the app root i have a folder libmylib in which an is placed:
    LOCAL_PATH := $(call my-dir)

    include $(CLEAR_VARS)

    LOCAL_MODULE := mylib
    LOCAL_SRC_FILES := ../../lib/armeabi/


    The placed in jni contains
    $(call import-module, mylib)

    Running ndk-build works fine and copies the libraries to libs/armeabi.
    In my MainActivity i call
    This all works good, but i also need, which is involved the same way. But while loading Qt5Core the application crashes with
    @UnsatisfiedLinkError: Unknown Failure@

    Is there a better way to get the qt libraries to the android device? Next to the fact that a library project does not generate the necessary libraries, i needed to turn the library into a small application which was deployed to the device. Now Qt created a folder android-builds which contained all those libraries.
    I copied these as necessary to my android application, but as said, as soon as i try to load qt5core it crashes.

    Is it possible to build mylib such that it contains all required information and i only need to add one library?

    Thank you!

    Kind Regards!

  • no ideas how to build a standalone library?

  • I'm also attempting the same thing - hopefully someone can enlighten both of us.

    dualfaces, I made some headway by statically compiling Qt. If you don't need to create a QGuiApplication object, this might be enough for you. I'm stuck on creating the QGuiApplication object because it can't find the android platform library, even though I have packaged it into my APK.

  • Dear friends!

    I found this situation in my project and did't find any solutions.

    Something new in this case?

  • Same issue here!

    Is it a bug of Maybe we could include the code files in ours libraries instead of reference libQt5Core...

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.