Important: Please read the Qt Code of Conduct -

Cannot load library on Android devices < 5.x.x (API <21)

  • Hello everybody.

    My project structure is as follows (root .pro file):
    (the actual naming, i.e. lib0, lib1, etc... is different in my project)

    SUBDIRS += \        
            module/shared-lib0 \
            module/shared-lib1 \
            module/shared-lib2 \
    # C++ QML plugins
    SUBDIRS += \
            qml/Plugin0 \
            qml/Plugin1 \
    # apps (executables, including test ones)
    SUBDIRS +=  \

    In my app/myapp .pro i have defined the qmake variable:

        $$DESTDIR/qml/Plugin0 \

    I am also enabling my custom plugins in the execution of main:


    When I run my app against API >=21, everything seems to be deployed correctly - the app is working as expected.
    But, when the application is deployed to a device that runs API < 21, I get the following error, which is followed by app crash:

    W/dalvikvm( 4700): threadid=12: thread exiting with uncaught exception (group=0x4106a438)
    E/AndroidRuntime( 4700): FATAL EXCEPTION: qtMainLoopThread
    E/AndroidRuntime( 4700): java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1891]:   151 could not load needed library '' for '' (load_library[1093]: Library '' not found)
    E/AndroidRuntime( 4700): 	at java.lang.Runtime.load(
    E/AndroidRuntime( 4700): 	at java.lang.System.load(
    E/AndroidRuntime( 4700): 	at$
    E/AndroidRuntime( 4700): 	at$
    E/AndroidRuntime( 4700): 	at$
    E/AndroidRuntime( 4700): 	at

    I can remedy this by explicity loading the libraries in the main activity, i.e. (onCreate method - Java side):


    (I have also loaded the plugin libraries explicity, with the correct order.)
    Although on some devices (API < 21) it seems to work (tried 4.1.2), while on others I get errors due to custom plugins loading (tried 4.2.2):

    too many libraries when loading ""

    and tons of warnings regarding the libEGL:

    libEGL  ( 2237): no more slots for ....

    I am targeting API >=16 (as per minimum requirements).
    Using Qt 5.12.0, Clang compiler armeabi-v7a.

    I have searched the www for any information, but came up empty...

    Does anybody have any suggestions or steps I could take to remedy this?

    Thank you and best regards,

Log in to reply