Important: Please read the Qt Code of Conduct -

SQLiteCipher plugin for iOS/Android. How?

  • Hello all!

    I am using devbean/QtCipherSqlitePlugin. It's working perfectly for desktop. I've got failed on attempts of building for iOS and Android. There are Wiki - I've done everything mentioned. It's not working. What am I missing?


    ios {
        LIBS += -L$$PWD/addons/ssl/ios/lib/ -lssl -lcrypto
        INCLUDEPATH += $$PWD/addons/ssl/ios/include
        DEPENDPATH += $$PWD/addons/ssl/ios/include
        PRE_TARGETDEPS += $$PWD/addons/ssl/ios/lib/libssl.a
        PRE_TARGETDEPS += $$PWD/addons/ssl/ios/lib/libcrypto.a
        CONFIG(debug, debug|release) {
    	LIBS += -lsqlitecipher_debug
        } else {
    	LIBS += -lsqlitecipher


    #ifdef Q_OS_IOS
    #include <QtPlugin>

  • Found related issue. It's solving building troubles. But it's still not working in iOS/Android. Is there any suggestions of why?

  • Does anyone knows any step-by-step QtSqliteCipherPlugin installation manuals?

  • The diagnosis changed ... The QSqlDatabase::drivers() showing me in log this:

    1554392864465 StartDB() (Database->open()) true
    1554392864524 QSqlDatabase::drivers():  ("SQLITECIPHER", "QSQLITE")

    It seems that driver loaded now after previous plugin recompilations, but data not reading/writing only on iOS/Android. Why could it be? On desktop all is reading and writing.

  • Lifetime Qt Champion


    In the Run part of the Project panel, set the QT_DEBUG_PLUGINS to 1 and run your application. This will give you more information about what is happening.

  • @SGaist Already done it yesterday. There are

    QSqlQuery::prepare: database not open

    The question why it's happening only on iOS/Android but not on Desktop?

  • Lifetime Qt Champion

    Likely because you are trying to open your database somewhere you can't.

    What path are you using ? If using QStandardPaths, then check that the folder you get exists otherwise create it. Why ? Because the value you get comes from the system and is valid however, it's not guaranteed that the folder already exists. That's not a bug.

    If you are not using QStandardPaths then you should start doing it at least for the mobile platforms because they severely restrict where you can write data to.

  • It was about OpenSSL. it's not working if there no OpenSSL. Make sure that OpenSSL is working properly in Qt Project.

Log in to reply