I have 2 build flavors, say, flavor1 and flavor2.
I would like my application to be named, say, \"AppFlavor1\" when I build for flavor1 an
If you want to maintain localization for the app name in different flavors, then you can achieve it as follows:
1) Specify android:label in available in AndroidManifest.xml as follows:
2) Specify default value fo appLabel in app level build.gradle:
manifestPlaceholders = [appLabel:"@string/defaultName"]
3) Override the value for product flavors as follows:
productFlavors {
AppFlavor1 {
manifestPlaceholders = [appLabel:"@string/flavor1"]
}
AppFlavor2 {
manifestPlaceholders = [appLabel:"@string/flavor2"]
}
}
4) Add string resources for each of Strings (defaultName, flavor1, flavor2) in your strings.xml. This will allow you to localize them.