Project ERROR: Unknown module(s) in QT: location
I have installed and am running Qt Creator 4.3.1 based on Qt 5.9.1 on Ubuntu 18.04. I have QML file says:
import QtLocation 5.6
import QtPositioning 5.6
When I build, it give me this "Unknown module(s) in QT: location" error. I cannot google finding any help talking about this error.
@sjcoder Which Qt version do you use (please note that "based on" in "About QtCreator" dialog only says which version was used to build QtCreator).
Also, did you add QT += location in your pro file?
Yes, I have QT+=location in the pro file.
Hi and welcome to devnet,
What version of Qt are you using to build your application ?
What you showed is the about Qt Creator dialog content which is completely unrelated to the Kit you are using to build your application.
From "About Qt Creator" in Help menu, it says Qt Creator 4.3.1 based on Qt 5.9.1(GCC 5.3.120160406(Red Hat 5.3.1-6), 64 bit) . Built on Jun 20 2017.
Now the error message is :
file:///home/qchen2/workspace/scse-gui/sse_map.qml:3:1: module "QtLocation" version 5.6 is not installed
import QtLocation 5.6
Am I getting wrong version QtCreator to match for QtLocation 5.6? How to install the right version of QtLocation for my creator?
As already said twice, once by @jsulm and the other one by me, what is shown in this about box is completely irrelevant to the version of Qt you are using to build your application.
As just requested, give the information about the Kit you are currently using to build your application.
From the Build & Run Kits, it show Desktop Qt 5.9.1 64bit(default).
Looks like it's the 5.3 version that comes with your Qt 5.9.1.
Change to 5.3 eliminate that error. However there are new issue came up:
Here is my .qml file imported:
import QtQuick 2.0
import QtQuick.Window 2.0
import QtLocation 5.3
import QtPositioning 5.3
The new error is kind confusing to me:
QQuickView only supports loading of root objects that derive from QQuickItem.
If your example is using QML 2, (such as qmlscene) and the .qml file you
loaded has 'import QtQuick 1.0' or 'import Qt 4.7', this error will occur.
To load files with 'import QtQuick 1.0' or 'import Qt 4.7', use the
QDeclarativeView class in the Qt Quick 1 module.