Android: module "xy" is not installed



  • Heya,

    Some time ago I started this thread but never got any reply:
    https://forum.qt.io/topic/89902/qqmlapplicationengine-failed-to-load-component-module-qtmultimedia-is-not-installed

    I keep having this issue with the declarative camera and now also with Shape {}.

    Qt 5.11 in the meantime, build platform is Windows for Android API level 22, x86, but using 25 and ARM for both API levels exposes the same error message. I got rid of the "Qt.labs.settings is not installed" error by removing any reference to it and working around it.

    Now I get module "QtQuick.Shapes" is not installed and module "QtMultimedia" is not installed only.

    I have entirely followed the documentation.

    In the QML:
    import QtQuick.Shapes 1.0
    import QtMultimedia 5.8

    In the .pro file:
    QT += multimedia

    The documentation doesn't say anything about Shape {}, hence I assume I don't need to add anything in the .pro file apart from what's already there:

    QT += quickcontrols2

    I can build and run the application on Windows and Linux, but I cannot run it on Android due to that error message when the QML in question is loaded (via Loader).

    When the verbose output of the Android deployment tool is turned on in QtCreator, I do get a multimedia molule added. I haven't tried or checked for Shape (yet) as I assume it to be the same issue as with QtMultimedia. I have also tried to include the .so files manually by utilising ANDROID_PACKAGE_SOURCE_DIR, but I don't think this is the problem here.

    The folder android-build\libs\x86 in my opinion contains the correct files:
    libQt5Multimedia.so
    libQt5MultimediaQuick.so
    libQt5Quick.so
    libQt5QuickControls2.so

    • lots of others.

    I can't see or find anything in the documentation I may have missed.

    Does anyone have an idea what might be wrong?

    I did an extensive search for these issues and even found several sources with the same problem. However, no solution has been provided anywhere. One source suggests the import version numbers might be wrong. I have tried several different version numbers by always entirely deleting the build directory beforehand, but to no avail. My current code contains what the documentation states but still no luck.

    One example is this one:
    https://bugreports.qt.io/browse/QTBUG-48047


  • Moderators

    @Padlock
    for the QML imports you do not have to change anything in your .pro file.
    The just need to be in one of the import paths.



  • I'm not sure I understand. How should I adjust the import paths manually?
    I thought the Android deployment tool checks the QML files for imports, does it not?



  • I've been able to identify the culprit about a week ago.

    The qmlimportscanner does not examine the .pro file to see what QML files are included in the project. It also doesn't care about what's in the.qrc file(s).

    Instead, it blindly adds the modules it can find by diving into the QML files in the folder where the .pro file resides, including subfolders. Any QML file above the directory that contains the .pro file is ignored.

    I created a simple .qml file in the same directory as the .pro file. Then I only added the import lines that are used within all my .qml files in other folders. Since this lead to a syntax complaint I also added the text Page {} after the last import line.

    import QtQuick 2.9
    import QtQuick.Layouts 1.3
    import QtQuick.Controls 2.4
    import QtQuick.Shapes 1.11
    import QtMultimedia 5.8
    import QtQuick.Window 2.11
    
    Page {
    }
    

    Note that this file is not referenced in the .pro file and is of course not part of the project/application at all. It only exists for the purpuse that qmlimportscanner includes the correct modules.



  • @Padlock said in Android: module "xy" is not installed:

    Instead, it blindly adds the modules it can find by diving into the QML files in the folder where the .pro file resides, including subfolders. Any QML file above the directory that contains the .pro file is ignored

    With your help, I created a symbolic link next to my project *.pro file to where my qml files reside, like below, it worked:

    $ ln -sv ../editorlib/qml/ qml
    qml -> ../editorlib/qml/
    

    Now I have:

    $ ls -lh
    total 32
    -rw-r--r--  1 aec  staff   253B Dec 11 13:18 deployment.pri
    -rw-r--r--  1 aec  staff   3.3K Dec 17 15:15 main.cpp
    lrwxr-xr-x  1 aec  staff    17B Dec 29 11:20 qml -> ../editorlib/qml/
    -rw-r--r--  1 aec  staff   1.4K Dec 29 10:54 standalone.pro
    

    After adding above symbolic link, qml import scanner can find QML dependencies with such messages:

    -- Appending dependency found by qmlimportscanner: /Users/aec/Qt5.11.3/5.11.3/android_armv7/qml/QtQuick/Extras/DelayButton.qml
        -- Appending dependency found by qmlimportscanner: /Users/aec/Qt5.11.3/5.11.3/android_armv7/qml/QtQuick/Extras/DelayButton.qmlc
        -- Appending dependency found by qmlimportscanner: /Users/aec/Qt5.11.3/5.11.3/android_armv7/qml/QtQuick/Extras/designer/CircularGaugeSpecifics.qml
        -- Appending dependency found by qmlimportscanner: /Users/aec/Qt5.11.3/5.11.3/android_armv7/qml/QtQuick/Extras/designer/CircularGaugeSpecifics.qmlc
        -- Appending dependency found by qmlimportscanner: /Users/aec/Qt5.11.3/5.11.3/android_armv7/qml/QtQuick/Extras/designer/DelayButtonSpecifics.qml
        -- Appending dependency found by qmlimportscanner: /Users/aec/Qt5.11.3/5.11.3/android_armv7/qml/QtQuick/Extras/designer/DelayButtonSpecifics.qmlc
        -- Appending dependency found by qmlimportscanner: /Users/aec/Qt5.11.3/5.11.3/android_armv7/qml/QtQuick/Extras/designer/DialSpecifics.qml
    


  • @Padlock
    want to thank you!
    this was super useful.


Log in to reply