My Android manifest file defines the app name as follows:
android:label=\"@string/app_name\"
A corresponding entry for app_name exists in r
Shouldn't have to mess with a 'resValue.' You can use the debug sourceset which will allow you to redefine other strings in debug as well. Create the following file and redefine the 'app_name' string in there.
src/debug/res/values/strings.xml
Just make sure you don't have anything like the following in your build.gradle's sourceSets
debug.setRoot('build-types/debug')
I came across the same issue too.
My solution is to use Manifest-placeholder
.
<application
android:label="${APP_NAME}"
tools:replace="android:label">
In your defaultConfig
closure, set the value
defaultConfig {
addManifestPlaceholders([APP_NAME: "@string/app_name"])
}
And Change that value in your flavors.
buildTypes {
beta {
applicationIdSuffix ".beta"
debuggable true
addManifestPlaceholders([APP_NAME: "MyTest Beta"])
}
}
Drawback:
To fix that drawback, you can combine Manifest-placeholder
and resValue
, which is to create a resource use resValue
and to change android:label
to your resource.