QtCreator APK fails to include icon files
-
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 underandroid-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 withdrawable-*
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 thevalues
sub-directory and doesn't include any of thedrawable-*
sub-directories and icons they're supposed to containAndroidManifest.xml
file doesn't contain the reference to theicon
I set in the project source directoryAndroidManifest.xml
file doesn't contain the correct custom package name I set in project source directory, it's set toorg.qtproject.example.myappname
- The generated APK package also doesn't include the
drawable-*
sub-directories underres
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.
-
Do you set
ANDROID_PACKAGE_SOURCE_DIR
to yourandroid-sources
in .pro file?When you open your manifest file through Qt Creator, does it show the manifest edit page?
-
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! 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).
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
-
@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).