module “QtQuick.Controls” is not installed

This error comes on runtime of a QML app, I got this error on my Yocto build and, /usr/lib/qt5/qml/QtQuick/ does not contain a directory Controls.

To fix this error

Add these to your conf file. Edit the conf file

build/conf/local.conf

then add this to your conf file

IMAGE_INSTALL_append = " qtdeclarative-qmlplugins qtquickcontrols-qmlplugins"

In some cases this, wont bring change check whether /usr/lib/qt5/qml/QtQuick/ contain a directory named Controls else the change is not affected. Then make these chnages to your conf file

PACKAGECONFIG_append_pn-qtbase = " accessibility"
PACKAGECONFIG_append_pn-qtquickcontrols = " accessibility"

IMAGE_INSTALL_append = " qtdeclarative-qmlplugins qtquickcontrols-qmlplugins"

and rebuild Yocto.

Happy Hacking 🙂