Android - using Local Storage



  • Hi,
    I have trouble importing Local Storage module on my google nexus 7 (2013), Android 4.4. I am using Qt 5.2.0, 3.0.0-rc1.
    Creating a Hello World app

    @import QtQuick 2.0
    import QtQuick.LocalStorage 2.0

    Rectangle {
    width: 360
    height: 360
    Text {
    text: qsTr("Hello World")
    anchors.centerIn: parent
    }
    MouseArea {
    anchors.fill: parent
    onClicked: {
    Qt.quit();
    }
    }
    }@

    I am getting an error when run on my tablet

    @W/Qt (25195): assets:/qml/myappstorage/main.qml:2 ((null)): assets:/qml/myappstorage/main.qml:2:1: module "QtQuick.LocalStorage" plugin "qmllocalstorageplugin" not found @

    Running this app on Windows results in no such error. I am using this only as an example, I already have a .js file which crashes at the same line with same error (again, no trouble running it on Windows)

    @.import QtQuick.LocalStorage 2.0 as SQL@

    Now I have already put a lot of work into that .js file and want to keep working with it. Am I doing something wrong with importing Local Storage module? Is there some kind of a workaround?

    Thanks for answer.



  • Try to add to your .pro:

    QT += sql


  • Moderators

    seems like your qmllocalstorageplugin doesn't get deployed to the device



  • I've faced this problem too.

    Setting verbose log in "Deploy Configuration", shows QtCreator trying to including qmllocalstorageplugin, but it's removing later (dependency).

    Putting QT += sql in .pro resolve my problem.

    Deploy log.....

    .
    .
    .
    Appending dependency from xml: qml/QtQuick/LocalStorage/libqmllocalstorageplugin.so
    Appending dependency from xml: qml/QtQuick/LocalStorage/plugins.qmltypes
    Appending dependency from xml: qml/QtQuick/LocalStorage/qmldir
    .
    .
    .
    -- Skipping C:\Qt\Qt5.2.0RC1\5.2.0-rc1\android_armv7/qml/QtQuick/LocalStorage/libqmllocalstorageplugin.so. It has unmet dependencies: lib/libQt5Sql.so.
    .
    .
    .



  • Thank you very much!

    I was struggling with getting libQt5Sensors.so deployed to the device. Initially, adding "QT += sensors" did not help, but after a rebuild and a deploy it worked like a charm!

    [quote author="TioRoy" date="1385996729"]I've faced this problem too.

    Setting verbose log in "Deploy Configuration", shows QtCreator trying to including qmllocalstorageplugin, but it's removing later (dependency).

    Putting QT += sql in .pro resolve my problem.

    Deploy log.....

    .
    .
    .
    Appending dependency from xml: qml/QtQuick/LocalStorage/libqmllocalstorageplugin.so
    Appending dependency from xml: qml/QtQuick/LocalStorage/plugins.qmltypes
    Appending dependency from xml: qml/QtQuick/LocalStorage/qmldir
    .
    .
    .
    -- Skipping C:\Qt\Qt5.2.0RC1\5.2.0-rc1\android_armv7/qml/QtQuick/LocalStorage/libqmllocalstorageplugin.so. It has unmet dependencies: lib/libQt5Sql.so.
    .
    .
    .

    [/quote]


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.