Solved Error while deploying from Ubuntu 14.04 to Raspberry Pi 3
-
Hi!
I set up Qt 5.9.1 on Ubuntu 14.04 and I compiled Qt 5.9.1 for Raspberry Pi 3.
After that I configured QtCreator for Raspberry Pi 3.
So far so good.I created a standard Qt Quick Application for testing.
On Ubuntu everything is fine.
But when I am selecting the Kit for Raspi and try run it on the Raspi I get an error:QQmlApplicationEngine failed to load component file::/main.qml:-1 File not found
This is the code in the main.cpp:
#include <QGuiApplication> #include <QQmlApplicationEngine> int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QQmlApplicationEngine engine; engine.load(QUrl("qrc:/main.qml")); if (engine.rootObjects().isEmpty()) return -1; return app.exec(); }
Obviously there seems to be a problem with the ressources.
I searched in the internet for a solution but without success.Has anyone an idea what the problem could be?
Regards, MHermann
-
For remote targets you need to add a deploy step, to copy the application to the remote target. Is there something like
target.path = /home/pi INSTALLS + = target
in your .pro file?
-
@sneubert: Thanks for your answer.
I already added two lines like these to the end of my .pro file.
The problem seems to be related to QtQuick.
Because if I run a Qt Widgets Application it works on Ubuntu and on the Raspi.
But if I try to run a Qt Quick Application it works on Ubuntu, but I get these two errors on the Raspi.QQmlApplicationEngine failed to load component file::/main.qml:-1 File not found
I don't have that much experience with Qt and Raspi...
Maybe there has to be an additional library or I have to install something on the Raspi or I have to set a path??? -
I found the problem and the solution.
There were still old Qt 5.6 libraries on the Raspi.
I copied the Qt libraries from the locally mounted Raspi image to the Raspi via rsync.
And now the applications are running on the Raspi. -
@MHermann Stuck with exact same problem. Can you be more specific on how you solved it? i don't understand the solution you put down here. can you be detailed?