"QtQuick" The specified module could not be found
-
I'm trying to compile a project on Windows 10 Pro 64 bit using Qt 5.7 MinGW 5.3.0. but I encounter the following error:
qrc:/main.qml:25 plugin cannot be loaded for module "QtQuick": Cannot load library C:\Qt\Qt5.7.0\5.7\mingw53_32\qml\QtQuick.2\qtquick2plugind.dll: The specified module could not be found.I've checked the path and the file is there but seems that for some reason is unable to find/load it.
Here is the main.qml:
import QtQuick 2.2 import QtQuick.Window 2.1 Window { id: windowID visible: true width: 800 height: 600 minimumHeight: 600 minimumWidth: 800 // other componenets }.pro file:
TEMPLATE = app QT += qml quick widgets network concurrent SOURCES += // list of sources RESOURCES += qml.qrc CONFIG += c++11 linux { // includes + libs paths } win32 { // includes + libs paths } macx { // includes + libs paths } # Additional import path used to resolve QML modules in Qt Creator's code model QML_IMPORT_PATH += "UI" # Default rules for deployment. include(deployment.pri) HEADERS += // list of headersThe project builds successfully on Ubuntu 16.04 LTS with Qt 5.7 64 bits and OS X El Capital with Qt 5.7 64 bits.
What I've tried so far:- Qt 5.5.1, 5.4.2 and 5.4.0 on Windows 10 Pro 64 bits.
- Qt 5.7 and 5.4.0 on Windows 8 Pro 64 bits.
- created an empty project with Qt 5.7 on Windows 10 and the it ran without any issues.
- copied the file in the build folder but this time it specifies the build path:
qrc:/main.qml:25 plugin cannot be loaded for module "QtQuick": Cannot load library \PATH\TO\BUILD\build-${PROJECT-NAME}-Desktop_Qt_5_7_0_MinGW_32bit-Debug\debug\QtQuick.2\qtquick2plugind.dll: The specified module could not be found. -
Are you sure you used 'windeployqt' to automatically handle QML dependencies? I encountered a similar problem because my qml content is embedded in the cpp file. At first, the packaging did not successfully identify the required dependencies. I manually copied the qml directory to the program directory, and then a similar error occurred. If you are in a similar situation, I suggest copying the qml part to a new file (without changing the existing code structure, the new file only allows windeployqt to recognize dependencies), and then repackaging it with the parameter "-- qmldir<Your_Cew_QML_dir>". In addition, if it's just a plugin issue, you can try searching for the qmldir file in the directory where the target DLL file is located, and open it with Notepad to find a similar line:
plugin qquick3dplugin
And delete it. However, after deletion, there is a high probability of other errors occurring