Got errors when deployed QtQuick2 app



  • I want to make standalone app for Ubuntu Linux. So I've built app using qmake + make tools. In main.qml there're some imports
    @import QtQuick 2.0
    import QtQuick.Controls 1.1
    import QtQuick.Layouts 1.1
    import QtQuick.Window 2.1@

    After "qmake + make" I copy Qt5.3 so-files to my app's build directory (I know which libs I use after calling ldd tool). I copy plugins into their subdirectories after I've tried to run my app in clean Ubuntu with Qt5.3 prerequisites installed and got debug info with QT_PLUGINS_DEBUG=1 set. I run my app with LD_LIBRARY_PATH set to local directory where copied Qt5 libs are located.

    So now to app is loading all so-libs that it needs but catches errors with these console logs.

    @QQmlApplicationEngine failed to load component
    qrc:///main.qml:2 module "QtQuick.Controls" is not installed
    qrc:///main.qml:3 module "QtQuick.Layouts" is not installed
    qrc:///main.qml:4 module "QtQuick.Layouts" is not installed
    qrc:///main.qml:1 module "QtQuick" is not installed
    ...@

    Please help me to overcome this problem. I've read lots of docs about Qt5 apps' deployment rules but have no idea about proper ways of deploying Qt5 apps that use Qml. I don't want to force users of this app to install Qt5 manually. These users should be able to run their Ubuntu 12.04 LTS and install my app with simple prerequisites that can be installed automatically. As far as I know Qt5 is available in 14.04 LTS and it's not Qt5.3.



  • This might help:
    http://qt-project.org/doc/qt-4.8/deployment-plugins.html
    I don't believe you set up the plugin directory correctly.



  • What plugin I'm missing? E.g. I have ./platforms/libqxcb.so plugin library correctly loaded into the app. Other plugins

    @./platformthemes/libqgtk2.so
    ./generic/*
    ./platforminputcontexts/*@

    also loaded correctly. So what plugin I'm missing when I get such logs

    @QQmlApplicationEngine failed to load component
    qrc:///main.qml:2 module "QtQuick.Controls" is not installed
    qrc:///main.qml:3 module "QtQuick.Layouts" is not installed
    qrc:///main.qml:4 module "QtQuick.Layouts" is not installed
    qrc:///main.qml:1 module "QtQuick" is not installed
    ...@



  • Set the QML2_IMPORT_PATH so that QML plugins can be found by the engine.




Log in to reply
 

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