I would like to create 2 different APKs (release and debug) using Gradle and I want to use different names for them ('appName' and 'appName debug').
I've found some solutions but it doesn't work for me:
link 1
link 2
I would like to install both apks on the device but I have the following error:
Duplicate resources:
...\src\release\res\values\config.xml:string/config_app_name,
...\src\main\res\values\config.xml:string/config_app_name
If I delete the config_app_name key from the main\res\values\config.xml then Gradle says the the key was not found.
I have 3 manifest files:
...\src\main\AndroidManifest.xml (this uses the `android:label="@string/config_app_name"`)
...\src\release\AndroidManifest.xml
...\src\debug\AndroidManifest.xml
buildTypes {
debug {
packageNameSuffix ".debug"
versionNameSuffix "-debug"
buildConfig "public static final String PROVIDER_AUTHORITY = \"" + PROVIDER_DEBUG + "\";"
signingConfig signingConfigs.debug
}
release {
buildConfig "public static final String PROVIDER_AUTHORITY = \"" + PROVIDER_RELEASE + "\";"
signingConfig signingConfigs.release
}
}
sourceSets {
debug {
java.srcDirs = [
'src/main/java']
res.srcDirs = [
'src/main/res',
'src/debug/res']
}
release {
java.srcDirs = [
'src/main/java']
res.srcDirs = [
'src/main/res',
'src/release/res']
}
}
Is it possible to use one common key (strings, integers, dimens) in the main part of the project and override it in the release/debug part?
Thanks in advance.