My Android manifest file defines the app name as follows:
android:label="@string/app_name"
A corresponding entry for app_name exists in res/values/strings.xml
Now, in my build.gradle, I redefine the app name for beta build as follows:
buildTypes {
beta {
applicationIdSuffix ".beta"
debuggable true
resValue "string", "app_name", "MyTest Beta"
}
}
However, when I assemble the package, Gradle complains of a duplicate string resource.
I could simply remove the app_name token from string.xml. However, in that case, Android Studio reports a problem with the manifest file.
How do I fix this? Regards.
<string name="app_name">@string/app_name_alias</string>in xml andresValue "string", "app_name_alias", "MyTest Beta"in gradle (android studio will showing "an error" in resources but this should at least compilestrings.xmland adding it as aresValuein gradle call Build -> Clean Project. After that call Build -> Make Project. The problem with manifest should gone