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. QML files not deployed/found on Android
QtWS25 Last Chance

QML files not deployed/found on Android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
androidqmldeploy
5 Posts 2 Posters 2.8k 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.
  • T Offline
    T Offline
    torpeanders
    wrote on 25 Jul 2017, 08:12 last edited by torpeanders
    #1

    My project has a qrc which lists the qml files I use. When I deploy and run to an Android device it seems that the qml files are not there.

    W/gui ( 9855): qrc:///main.qml:-1 ((null)): default: warning: unknown: qrc:///main.qml: File not found

    During the build process I get a lot of messages like this:

    -- Adding '/home/anr/src/gui/Gui.qml/windows' as QML dependency
    -- Skipping because file does not exist.

    Do I need to handle the qml files in my project in a special way for deployment to Android?

    Edit. I'm using Qt 5.7.1, NDK r10e, SDK r25.2.5 and Qt Creator 4.3.1.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      torpeanders
      wrote on 25 Jul 2017, 10:10 last edited by
      #2

      Inspecting the APK I see none of my QML files in the assets folder.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        torpeanders
        wrote on 25 Jul 2017, 11:24 last edited by
        #3

        I think this may be what I'm struggling with: https://bugreports.qt.io/browse/QTBUG-55259

        1 Reply Last reply
        0
        • T Offline
          T Offline
          torpeanders
          wrote on 25 Jul 2017, 13:08 last edited by
          #4

          Last reply to myself for the day :)

          Since the qml files are added to a qrc file, they should be embedded into my application. Have to qrc files, both added with "RESOURCES+=" in pro/pri files.

          I added this code to my application to see what was inside:

          QDirIterator it(":", QDirIterator::Subdirectories);
          while (it.hasNext()) {
              qInfo() << it.next();
          }
          

          The resources from one of them are added to my application, the resources from the other is missing. From the Makefiles in my shadow build directory the two qrc files seem to be treated the same.

          1 Reply Last reply
          0
          • P Offline
            P Offline
            Pablo J. Rogina
            wrote on 9 Aug 2017, 18:27 last edited by
            #5

            @torpeanders I always use just one resource file per project, and although not completely sure, it looks like having RESOURCES += ...
            is intended for just one resource file.
            I'm not sure if you need two resource files, I'd ask what is your use case for that, please remember that you can have subfolders to split just in case; i.e. I usually have a subfolder images for the icons and a subfolder translations and then it's a question of using the proper path

            QIcon(":/images/cut.png")
            

            So if even this trick cannot avoid you having two resource files, please have a look at the documentation as it explains how to create/deal with external resource files (it'll be your 2nd one).

            Upvote the answer(s) that helped you solve the issue
            Use "Topic Tools" button to mark your post as Solved
            Add screenshots via postimage.org
            Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

            1 Reply Last reply
            0

            • Login

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