Qt modules are not installed
-
Hi everyone!
I'm working with Qt for Android and I could build and create successfully the apk but on runtime I receive a strange warning.W libAPPEXAMPLE.so: assets:/APPEXAMPLE/main.qml:3 ((null)): assets:/APPEXAMPLE/main.qml:3:1: module "QtQuick.Window" is not installed W libAPPEXAMPLE.so: assets:/APPEXAMPLE/main.qml:2 ((null)): assets:/APPEXAMPLE/main.qml:2:1: module "QtQuick" is not installed W libAPPEXAMPLE.so: assets:/APPEXAMPLE/main.qml:4 ((null)): assets:/APPEXAMPLE/main.qml:4:1: module "QtMultimedia" is not installed
I could copy the qml modules into the apk in assest with:
ANDROID_EXTRA_PLUGINS += \ PATH_TO_WHATEVER
but I'm not sure if this is the right place or if the files should be copy in /assets/--Added-by-androiddeployqt--/ (as I saw in a qt example)
Could someone explain me how to copy properly the qml modules into the apk and how to set the path (if needed).
I also want to load some qml modules that I've done, I guess it would be pretty much the same, isn't it?
Thanks!
Fernando -
After almost a week and no progress in this topic, I tried with a basic application template. I created a new project (Application --> Qt Quick Application) and deployed a Hello World to my android device. Everything went just fine until I wanted to move the project's file. Qt creator does not have a neat structure for the examples to I wanted to have this:
AppName
| -----project ---> .pro, .pri files
|
| -----src ---> .cpp files
|
| -----include ---> .h files
|
| -----resources ---> .qrc, .qml. images, sounds, etc filesI moved the files one by one and made a deploy in every step I took BUT when I moved the .pro and .pri files I received the same error I asked before:
W libTemplate_Android.so: (null):0 ((null)): QQmlApplicationEngine failed to load component W libTemplate_Android.so: (null):0 ((null)): qrc:/main.qml:1 module "QtQuick" is not installed W libTemplate_Android.so: qrc:/main.qml:2 module "QtQuick.Window" is not installed W libTemplate_Android.so: qrc:/main.qml:1 module "QtQuick" is not installed W libTemplate_Android.so: qrc:/main.qml:2 module "QtQuick.Window" is not installed 10-18 10:55:06.785 14226 14256 W libTemplate_Android.so:
Does anyone have idea about what I'm doing wrong or if I'm doing something that it's prohibited in qt? Any ideas how to solve this?
Am I using the right file structure for my project?Thanks!!
Fernando -
Hi,
Do you have a AppName.pro file ?
-
Hey @SGaist !! Yes, I do. I let it here. I'm almost 100% sure that there is no problem with my .pro. Anyways, I find really strange that Qt has problem with the location of the files. What I know (from Qt documentation) is that resources must be located in the .qrc folder (or subfolder). But there is no comments about the relation between .pro and .qrc. What I could do to solve this is:
- Create a dummy.qml with the includes and an empty Item
- Locate the file with the .pro
- Add the file under OTHER_FILES
- Use the assets approach to access qml and other resources
Now, the QtQuick, QtQuick.Window and others Qt Modules are recognized but I'd like to use the qrc approach since it is multiplatform.
TEMPLATE = app QT += qml quick CONFIG += c++11 SOURCES += \ ../src/main.cpp \ # Additional import path used to resolve QML modules in Qt Creator's code model QML_IMPORT_PATH = # Default rules for deployment. include(../deployment.pri) RESOURCES += ../qrc/qml.qrc DISTFILES += \ android/AndroidManifest.xml \ android/gradle/wrapper/gradle-wrapper.jar \ android/gradlew \ android/res/values/libs.xml \ android/build.gradle \ android/gradle/wrapper/gradle-wrapper.properties \ android/gradlew.bat ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
-
What does you main .pro file look like ?
-
Then I may have misunderstood your setup.
Isn't that .pro file in a subfolder called project in your source tree ?
-
@SGaist It might. Older qmake (or Qt Creator) versions definitely would get confused. I'm not sure about newest releases, I vaguely recall mentions of some fixes in this area, but I have not tested it. I keep my .pro files ordered as Qt expects it to ;)
-
Hey! Sorry for my late reply but it's 9am here! I tried (as @sierdzio said) just one .pro but I separated my files in folders (not the subdirs structure). Since I'm relative new to Qt and I discover every day something new, I don't know if what I've done it's ok or not.
Know I put all my resources (qml, sounds, images, etc) in the .pro's folder and I'm trying to make it work. It was just curiosity aboute why the .qrc has to be placed at the same level or in a subfolder from the .pro.
I'll mark this post as SOLVED because the problem is related to the project's structure and there is no problem with Qt.
Thank you guys!!
-
Currently the only rule I am aware of is that all the files you put in the .qrc must in the same folder or in a subfolder of where the .qrc file lives.
You may have found something new.