How to provide different Android app icons for different gradle buildTypes?

后端 未结 5 1080
隐瞒了意图╮
隐瞒了意图╮ 2020-11-29 19:12

I have two build types set in my gradle file: debug and release. I\'d like to be able to set a different app icon for the debug build

5条回答
  •  再見小時候
    2020-11-29 20:03

    Step by step solution, including replacing mipmap-anydpi-v26 and keeping files for all dimensions:

    First define in build.gradle (Module: app) your build type in android -> buildTypes -> debug, internal, etc

    On the project hierarchy, below Android, right click on app -> New -> Image Asset -> in Path choose your icon -> any other changes on Background Layer and Legacy -> Next -> in Res Directory choose your desired build type (debug, internal, main, etc) -> Finish

    That way the icons will replace every old icon you had.

提交回复
热议问题