Qml gui is crashing: plugin cannot be loaded for module "QtQuick.Controls".
-
Hello,
I've upgraded my application from qt 5.12.7 to 5.15.2.
Currently I'm facing an issue, the gui isn't loading and the logs are given below
QQmlApplicationEngine failed to load component qrc:/main.qml:51:9: Type Header unavailable qrc:/Header.qml:70:13: Type Button unavailable file:///opt/Qt/5.15/gcc_64/qml/QtQuick/Controls.2/qmldir: plugin cannot be loaded for module "QtQuick.Controls": Cannot install type 'VerticalHeaderView' into protected module 'QtQuick.Controls' version '2' <Unknown File>: Cannot install type 'HorizontalHeaderView' into protected module 'QtQuick.Controls' version '2' <Unknown File>: Cannot install element 'SplitHandle' into protected module 'QtQuick.Controls' version '2' <Unknown File>: Cannot install type 'SplitView' into protected module 'QtQuick.Controls' version '2' <Unknown File>: Cannot install element 'Overlay' into protected module 'QtQuick.Controls' version '2' <Unknown File>: Cannot install type 'MenuBarItem' into protected module 'QtQuick.Controls' version '2' <Unknown File>: Cannot install type 'MenuBar' into protected module 'QtQuick.Controls' version '2' <Unknown File>: Cannot install type 'ActionGroup' into protected module 'QtQuick.Controls' version '2' <Unknown File>: Cannot install type 'Action' into protected module 'QtQuick.Controls' version '2'Can someone help to solve it. My qml imports looks this
import QtQuick 2.12 import QtQuick.Window 2.12 import QtQuick.Controls 2.12 -
If it is during attempt to debug in QtCreator - it is a bug, cause plugins are not found when they should be, and I have the same issue.
If it is when you run application outside of QTCreator you need to make sure plugins are deployed and can be found by application. -
I've finally managed to find the issue. There is a duplicate QtQuick and Qt folder were created inside my build directory.
I think somehow the QtQuick controls was accessing this duplicate directories instead the real one. I've managed to fix it by removing the duplicated directory from build folder, and now it works. Thanks @alex_malyu for your response.