Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Android: QSqlitePlugin crashing application on Android device. Why?
Forum Updated to NodeBB v4.3 + New Features

Android: QSqlitePlugin crashing application on Android device. Why?

Scheduled Pinned Locked Moved Solved Mobile and Embedded
3 Posts 2 Posters 426 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bogong
    wrote on last edited by bogong
    #1

    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/libqsqlite.so
    Appending dependency from xml: plugins/sqldrivers/libsqlitecipher.so
    

    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 "libsqlitecipher.so" not found
    E AndroidRuntime: 	at java.lang.Runtime.load0(Runtime.java:897)
    E AndroidRuntime: 	at java.lang.System.load(System.java:1505)
    E AndroidRuntime: 	at org.qtproject.qt5.android.QtNative$4.run(QtNative.java:259)
    E AndroidRuntime: 	at org.qtproject.qt5.android.QtThread$2.run(QtThread.java:87)
    E AndroidRuntime: 	at org.qtproject.qt5.android.QtThread$1.run(QtThread.java:61)
    E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:761)
    

    What am I missing?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • B Offline
        B Offline
        bogong
        wrote on last edited by
        #3

        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/libcrypto.so
        	ANDROID_EXTRA_LIBS += $$PWD/libs/OpenSSL/lib/android/x86/lib/libssl.so
        	ANDROID_EXTRA_LIBS += $$PWD/libs/SqliteCipher/lib/android_x86/sqlitecipher/plugins/sqldrivers/libsqlitecipher.so
        
            }
        
        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved