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. [SOLVED] Qt sql database driver not loaded in android
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Qt sql database driver not loaded in android

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 2 Posters 3.7k 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.
  • D Offline
    D Offline
    deleted57
    wrote on 2 Mar 2014, 10:14 last edited by
    #1

    Hi all

    I'm developing an app suign Qt for android. This app need to use the sqlite engine. It work perfect under windows but when I move to android the following error come up and no possibility to use database:

    W/Qt ( 1017): kernel\qsqldatabase.cpp:785 (void QSqlDatabasePrivate::init(const QString&)): QSqlDatabase: QSQLITE driver not loaded
    W/Qt ( 1017): kernel\qsqldatabase.cpp:786 (void QSqlDatabasePrivate::init(const QString&)): QSqlDatabase: available drivers:
    W/Qt ( 1017): kernel\qsqldatabase.cpp:789 (void QSqlDatabasePrivate::init(const QString&)): QSqlDatabase: an instance of QCoreApplication is required for loading driver plugins

    Someone can help in fixing this issue? I verified the .so sqlite plugin is present into the folder with all other Qt .so libraries. Googling around for similar problem I found someone who suggest to add the path of the libraries at application startup but doesn't work for me. Currently no workaround found...

    Thank you

    1 Reply Last reply
    0
    • D Offline
      D Offline
      deleted57
      wrote on 3 Mar 2014, 11:04 last edited by
      #2

      Found the problem here. Basically I initialized my QSqlDatabase object inside the costructor of a private class. It work on Windows but it seem when compiled and ran for android the creation of this class was made before the main QApplication class. This cause the issue the QSqlDatabase try to load driver before the main app class was ready and fail...

      1 Reply Last reply
      0
      • L Offline
        L Offline
        leon.anavi
        wrote on 3 Mar 2014, 12:35 last edited by
        #3

        it is great that you have solved the issue on your own and shared the solution :)
        Could you please edit the title of the thread and append [SOLVED] as prefix to it? Right now there is no other mechanism to mark solved issues at the forum.

        http://anavi.org/

        1 Reply Last reply
        0
        • D Offline
          D Offline
          deleted57
          wrote on 3 Mar 2014, 12:52 last edited by
          #4

          Hi

          You right, just done. Very sorry I didn't though before. ^_^

          1 Reply Last reply
          0
          • L Offline
            L Offline
            leon.anavi
            wrote on 3 Mar 2014, 12:54 last edited by
            #5

            [quote author="Suppaman" date="1393851121"]Hi

            You right, just done. Very sorry I didn't though before. ^_^[/quote]

            Thanks :) I hope that in future more convenient and efficient ways to mark threads as solved and to highlight good answers will be implemented at Qt Project's website :)

            http://anavi.org/

            1 Reply Last reply
            0

            1/5

            2 Mar 2014, 10:14

            • Login

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