How to provide different launcher icon per product flavour
You have a couple options:
Switch to the new android studio/gradle layout and create folders for your productFlavors:
src/main/
- Shared code/resources across all flavorssrc/amazon
- Amazon specific code/resources across all flavorssrc/google
- Google specific code/resources accross all flavorsSo in your main manifest (
src/main/AndroidManifest.xml
) if yourandroid:icon
is@drawable/icon
, you would have the appropriate icon located insrc/amazon/res/drawable-*/icon.png
and likewise for the rest of your productFlavors.Keep your existing layout (and build.gradle) and append a resource directory to the
res.srcDirs
:
So, for your amazon sourceset:
android.sourceSets.amazon { res.srcDirs = ['res', '/path/to/amazon/res/dir']}
And then in your /path/to/amazon/res/dir/drawable-*
you would have your launcher icon.