Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt modules are not installed

Qt modules are not installed

Scheduled Pinned Locked Moved Solved Mobile and Embedded
qml android
14 Posts 4 Posters 7.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • FerniF Ferni

    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 files

    I 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

    jsulmJ Offline
    jsulmJ Offline
    jsulm
    Lifetime Qt Champion
    wrote on last edited by
    #3

    @Ferni If you're moving files around then you have to update your pro file. Check the paths there.

    https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    2
    • FerniF Offline
      FerniF Offline
      Ferni
      wrote on last edited by
      #4

      Hey @jsulm thanks for the answer!! Yeap, I didn't miss that. I could do the run qmake and build successfully and the problem is a runtime issue. I could not find anything yet in Qt's webpage about the problem :/

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #5

        Hi,

        Do you have a AppName.pro file ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • FerniF Offline
          FerniF Offline
          Ferni
          wrote on last edited by Ferni
          #6

          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:

          1. Create a dummy.qml with the includes and an empty Item
          2. Locate the file with the .pro
          3. Add the file under OTHER_FILES
          4. 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
          
          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #7

            What does you main .pro file look like ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • FerniF Offline
              FerniF Offline
              Ferni
              wrote on last edited by
              #8

              I wrote my main .pro file in the last reply

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #9

                Then I may have misunderstood your setup.

                Isn't that .pro file in a subfolder called project in your source tree ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • sierdzioS Offline
                  sierdzioS Offline
                  sierdzio
                  Moderators
                  wrote on last edited by
                  #10

                  @SGaist I think @Ferni has .pro file in a subfolder, but is not using SUBDIRS approach. Instead, all .pro/.pri files are stored in "project" dir.

                  (Z(:^

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #11

                    @sierdzio That's also what I've concluded and I wonder if this isn't why qmake might get lost.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • sierdzioS Offline
                      sierdzioS Offline
                      sierdzio
                      Moderators
                      wrote on last edited by sierdzio
                      #12

                      @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 ;)

                      (Z(:^

                      1 Reply Last reply
                      1
                      • FerniF Offline
                        FerniF Offline
                        Ferni
                        wrote on last edited by
                        #13

                        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!!

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #14

                          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.

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          1

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved