Different app names for different build flavors in Android?

Just add the string

<string name="app_name">app_name_string</string>

in the folders:

app/src/photographer_prod/res/values/strings.xml
app/src/agent_prod/res/values/strings.xml

You can also add resource values directly to your build.gradle file

productFlavors { {
    photographer_prod {
      resValue "string", "app_name", "the app name.."
    }
    agent_prod {
      resValue "string", "app_name", "the app name.."
    }
  }

In addition to Gabriele Mariotti's answer, make sure application / android:label attribute's value is set to @string/app_name in your AndroidManifest.xml file.


Remove <string name="app_name">app_name_string</string>.