Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-36495

samegame: use of localstorage in JS file no longer works on devices

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.2.1
    • Examples and Demos
    • None
    • iOS
      Android
    • iOS/tvOS/watchOS

    Description

      On Android the errors look like this

      qrc:///demos/samegame/samegame.qml:43 ((null)): qrc:///demos/samegame/samegame.qml:43:1: Script qrc:///demos/samegame/content/samegame.js unavailable
      qrc:///demos/samegame/content/samegame.js:42 ((null)): qrc:///demos/samegame/content/samegame.js:42:1: module "QtQuick.LocalStorage" plugin "qmllocalstorageplugin" not found

      On iOS, it helps to do the import additionally in a QML file (even though the QML doesn't use it), because it needs to be detected and packaged. But the game still doesn't run normally. Then the errors are

      QSqlDatabase: QSQLITE driver not loaded
      QSqlDatabase: available drivers:
      QSqlQuery::prepare: database not open
      qrc:///demos/samegame/content/samegame.js:475: Error: Driver not loaded Driver not loaded

      On Android, localstorage is actually installed though:

      /data/data/org.qtproject.example.samegame/qt-reserved-files/qml/QtQuick/LocalStorage
      /data/data/org.qtproject.example.samegame/qt-reserved-files/qml/QtQuick/LocalStorage/qmldir
      /data/data/org.qtproject.example.samegame/qt-reserved-files/qml/QtQuick/LocalStorage/plugins.qmltypes
      /data/data/com.android.browser/app_databases/localstorage
      /data/data/com.android.browser/app_databases/localstorage/data/local/tmp/qt/qml/QtQuick/LocalStorage
      /data/local/tmp/qt/qml/QtQuick/LocalStorage/libqmllocalstorageplugin.so
      /data/local/tmp/qt/qml/QtQuick/LocalStorage/plugins.qmltypes
      /data/local/tmp/qt/qml/QtQuick/LocalStorage/qmldir

      On desktop platforms the game is still OK. And I remember this game running on Android in the past, although it was quite slow to start.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Unassigned Unassigned
              srutledg Shawn Rutledge
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes