Rules for qmlimportscanner / androiddeployqt
When deploying a C++ and QML application from QtCreator to android, androiddeployqt uses qmlimportscan to determine the QML dependencies (like QtQuick Controls) and includes them in the APK, in the folder "assets/--Added-by-androiddeployqt--". My own QML files reside in a folder higher than the Qt Project but are added to the .pro file as sources. Up to Qt 5.3 this worked fine, starting with Qt 5.4 QML dependency resolution fails silently. It does work when i add a dummy qml file to the project with the import statements and add it to the same folder as the .pro file.
Do the Qml files have to reside in the project directory for qmlimportscan to work? Where can i find more documentation on the tool? In what other way could i tell androiddeployqt what qml files to include?
I have same problem with Qt 5.6.1. I have someLib.pri that has .qrc with QML files outside of main .pro project directory, and qmlimportscanner it fails with error like this:
-- Adding '/home/myuser/code/MainAppProject/res/qml/main.qml/qrc:/res/qml/SomeLib/SomeQmlComponent' as QML dependency -- Skipping because file does not exist.
Bug report already exists: https://bugreports.qt.io/browse/QTBUG-55259
I've run into deployment import-scanning issues enough times that personally I've just got in the habit of creating a hopefully "obvious" imports.qml with all the import statements for everything I think my application uses.