Different app names for different build flavors?

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.

<application
        ...
        android:label="@string/app_name"
        ...

This is less disruptive than creating new strings.xml under different built sets or writing custom scripts.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)