Runtime error - 'module "QtQuick" version 2.1 is not installed'
-
I'm trying to port a Qt 4.8.2 app that uses Qt Quick for part of the GUI over to Qt 5.1.1, using 64-bit Visual Studio 2012 and a pre-built 64-bit Qt 5.1.1 install. This app ran just fine under Qt 4.8.2.
Everything builds. When I run it up in the VS debugger, I get the error (with a reference to my qml file, which has an "import QtQuick 2.1" statement in it):
module "QtQuick" version 2.1 is not installed
I'm using a pre-built binary Qt install, I have put the installation's "bin", "plugins", and "qml" directories on my PATH, nothing seems to work.
This same error occurs when I run the qmlviewer app and load my QML file.
What is this error trying to tell me?
-
An update:
If I change the import to "import QtQuick 1.0" and run the qmlviewer from the command line:
qmlviewer MyFile.qml
then it works. The QML file contains only QtQuick 1 statements.
If I change the 1.0 back to 2.0, then the qmlviewer crashes when run from the command line.
-
I think you have to use qmlscene and not qmlviewer for QtQuick 2.0+
Also in the C++ part to load the qml be sure to use QQuickView or QQmlApplicationEngine and not QDeclarativeView.
-
Yes, thanks. I discovered I need qmlscene. However, it also gives me the "QtQuick not installed" error.
I had already converted my project to use QQuickView before I made the original post.
Any other suggestions? The lack of documentation on how to deploy QML apps on Windows is very frustrating. If you search for this error, all you see are solutions for linux, MacOS, Symbian, but not Windows.
-
[quote author="d_stranz" date="1380747913"]
I had already converted my project to use QQuickView before I made the original post.[/quote]
Excellent!
[quote author="d_stranz" date="1380747913"]
Any other suggestions?[/quote]Can you try it in QtCreator just to verify that it works there? If it works in QtCreator, there is something missing in the execution environment in Visual Studio. I would try setting QML2_IMPORT_PATH to point to C:\Qt\Qt5.1.1\5.1.1\msvc2010\qml (or similar path on your system).
You could also check the run environment used in QtCreator. I see that QTDIR is set to C:\Qt\Qt5.1.1\5.1.1\msvc2010 in my project here.
[quote author="d_stranz" date="1380747913"]The lack of documentation on how to deploy QML apps on Windows is very frustrating. If you search for this error, all you see are solutions for linux, MacOS, Symbian, but not Windows.[/quote]
You may find this "thread":http://qt-project.org/forums/viewthread/25714/ helpful.
-
bq. Can you try it in QtCreator just to verify that it works there?
That would be difficult, since this is a plugin-based system (modeled after QtCreator, actually). The QML I am developing is similar to QtCreator's "Open Project" start page.
I will probably try a diagnostic project that will just open and display the QML, somewhat like qmlscene. I will probably look at the sources for qmlscene, too. And I'll do it in VS2012 as well as QtCreator to see if there are differences.
Some interesting experiments. I have 4 or 5 different versions of Qt installed on my PC, most using binary distributions from qt-project, all of them installed as they come (only the install directory is changed, at install time).
If I run qmlscene in a 64-bit OpenGL-based 5.1.1 distro, qmlscene works there and I see my page as designed.
If I run qmlscene in a 64-bit ANGLE-based 5.1.1 distro, it fails with the "not installed" error. I also need a qt.conf file here, otherwise I get the "windows" plugin not found error. That's probably a clue, but I don't know what it means.
If I run qmlscene in a 32-bit ANGLE-based 5.1.1 distro, it works.
If I run qmlscene in a 64-bit, OpenGL-based Qt 5.1.0 distro, it works.
I have switched my VS environment between both of the 64-bit 5.1.1 distributions, but my own app gives the same error in each of them. I also need a qt.conf file in my app's runtime directory, otherwise I get the "windows" plugin not found error.
bq. You may find this thread [qt-project.org] helpful.
Thanks. I remember reading that once before, but I had forgotten about it. I'll give it another read to see if there are any insights.
-
Ha! From "this thread":http://qt-project.org/forums/viewthread/25714/
bq. Oh Eureka! There indeed was a dir QtQuick.2/ under the SDK; copying this as-is under the application directory did the trick.
Works for me, too!
Now I can't wait for the headaches I'm going to have when deploying this app on a customer's PC. :-(
-
..