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. QtCreator APK fails to include icon files

QtCreator APK fails to include icon files

Scheduled Pinned Locked Moved Solved Mobile and Embedded
5 Posts 3 Posters 1.4k 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.
  • U Offline
    U Offline
    Unix One
    wrote on last edited by
    #1

    Hello,

    I'm using QtCreator 4.6.2, Qt 5.10.1 on OpenSUSE Tumbleweed. I created a QtQuick project and added an AndroidManifest.xml file under android-sources. This works as expected and I'm able to use the UI to set various configuration options for the manifest.

    I set custom package name, and set application icons in the manifest, and I notice the res directory gets created with drawable-* directories underneath it, containing the icons I set. I verify the manifest file gets saved correctly in project source directory. So far, so good.

    However, when I build the APK, in the build-* project directory, I see that:

    • res directory only includes the values sub-directory and doesn't include any of the drawable-* sub-directories and icons they're supposed to contain
    • AndroidManifest.xml file doesn't contain the reference to the icon I set in the project source directory
    • AndroidManifest.xml file doesn't contain the correct custom package name I set in project source directory, it's set to org.qtproject.example.myappname
    • The generated APK package also doesn't include the drawable-* sub-directories under res

    The big issue is that I can't set my custom app icon.

    I tried manually adding all the icon files to the project and making sure they show up in the .pro file (along with the manifest file) - this didn't help. I recursive-grepped "org.qtproject.example" in source project directory and found no references.

    I'm unable to find anything on this online. Is there a simple step I'm missing to get the custom app icons and the correct manifest file copied from project source into the build directory and the APK? Has anyone seen and solved this? Thank you.

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

      Do you set ANDROID_PACKAGE_SOURCE_DIR to your android-sources in .pro file?

      When you open your manifest file through Qt Creator, does it show the manifest edit page?

      (Z(:^

      1 Reply Last reply
      2
      • U Offline
        U Offline
        Unix One
        wrote on last edited by
        #3

        Aha! Thanks for the tip - I hadn't come across this before. I actually had to set it to

        ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android-sources
        

        It would probably be helpful to add this to https://doc.qt.io/qtcreator/creator-deploying-android.html - which is what I was going off of (wonder how/if I can contribute to online docs).

        aha_1980A 1 Reply Last reply
        0
        • U Unix One

          Aha! Thanks for the tip - I hadn't come across this before. I actually had to set it to

          ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android-sources
          

          It would probably be helpful to add this to https://doc.qt.io/qtcreator/creator-deploying-android.html - which is what I was going off of (wonder how/if I can contribute to online docs).

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by aha_1980
          #4

          hi @Unix-One

          you can create a doc bugreport at bugreports.qt.io with a description of your desired change.

          Of course you can do the change yourself, but that requires a Qt Gerrit access and you need to clone the QtCreator repo to create a changeset.

          All together no big deal, but often a hurdle for first time contributors.

          in case you want to try anyway: https://wiki.qt.io/Setting_up_Gerrit

          regards

          Qt has to stay free or it will die.

          1 Reply Last reply
          2
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #5

            @aha_1980 said in QtCreator APK fails to include icon files:

            All together no big deal, but often a hurdle for first time contributors.

            Since a few weeks, Qt Project accepts patches sent via bugreports, too. So setting up gerrit may not be required (although it is still recommended).

            (Z(:^

            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