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
Remove app_name from strings.xml (else gradle will complain of duplicate resources). Then modify build file like this:
productFlavors {
flavor1{
resValue "string", "app_name", "AppNameFlavor1"
}
flavor2{
resValue "string", "app_name", "AppNameFlavor2"
}
}
Also make sure @string/app_name value is assigned for android:label attribute in the manifest.
This is less disruptive than creating new strings.xml under different built sets or writing custom scripts.