Important: Please read the Qt Code of Conduct -

Android: QSqlitePlugin crashing application on Android device. Why?

  • Hello all!

    I've done it for iOS and MacOS but I've got issue on Android device with QtCipherSqlitePlugin. It's not working under Android. I've done everything that is in instruction.

    It's in *.pro file

    LIBS += -L$$[QT_INSTALL_PLUGINS]/sqldrivers -lsqlitecipher

    and adding at time of building

    Reading Android dependencies for Qt5Sql
    Appending dependency from xml: plugins/sqldrivers/
    Appending dependency from xml: plugins/sqldrivers/

    But when it's starting on device it's crashing with this message:

    E AndroidRuntime: FATAL EXCEPTION: qtMainLoopThread
    E AndroidRuntime: Process: org.qtproject.example, PID: 5033
    E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "" not found
    E AndroidRuntime: 	at java.lang.Runtime.load0(
    E AndroidRuntime: 	at java.lang.System.load(
    E AndroidRuntime: 	at$
    E AndroidRuntime: 	at$
    E AndroidRuntime: 	at$
    E AndroidRuntime: 	at

    What am I missing?

  • Lifetime Qt Champion


    Looks like you are not deploying the plugin. Since it's not an official plugin, you likely shall manually add it to the list of things to deploy.

  • All library that using by application should be added manually into Android application. There are too possible ways:

    • Through build settings "Build Android APK"
    • Add "ANDROID_EXTRA_LIBS +=" into *.pro file, something like this:
    equals(ANDROID_TARGET_ARCH,x86) {
    	LIBS += -L$$PWD/libs/OpenSSL/lib/android/x86/lib/ -lcrypto
    	LIBS += -L$$PWD/libs/OpenSSL/lib/android/x86/lib/ -lssl
    	LIBS += -L$$PWD/libs/SqliteCipher/lib/android_x86/sqlitecipher/plugins/sqldrivers/ -lsqlitecipher
    	ANDROID_EXTRA_LIBS += $$PWD/libs/OpenSSL/lib/android/x86/lib/
    	ANDROID_EXTRA_LIBS += $$PWD/libs/OpenSSL/lib/android/x86/lib/
    	ANDROID_EXTRA_LIBS += $$PWD/libs/SqliteCipher/lib/android_x86/sqlitecipher/plugins/sqldrivers/

Log in to reply