android different app icon for each flavor

5k views Asked by At

I want to change the app icon for each product flavour of the android app. I already have a res folder for each flavour with different icon resources and they all are being replaced as expected, except for the app icon.

I also tried to create a separate manifest file for each flavour, so that each manifest would refer to the particular icon in the same directory. Renaming the app icon for each flavour was no use. The solution found here offered to replace the content of one manifest with this:

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools">
      <application
          tools:replace="android:icon"
          android:icon="@drawable/alternative_icon" />
    </manifest>

but it also gave no result.

Moreover, the icon displayed on the home screen and the one displayed in the application manager also differ: the home screen has the correct icon for the built flavour, the app manager has another one and viceversa. Has anybody had the same problem?

1

There are 1 answers

0
milka On

Solved the problem by using different applications ids for each flavour in gradle, the tip from here.