ResConfigs for each build type

How can I override resConfigs for each type of assembly? I read that aromas will allow this, but I do not use them. I just want my debugging to build another set of supported languges.

Here is what I tried:

 buildTypes { debug { resConfigs "de", "en" // allow also german in debug builds } release { signingConfig signingConfigs.release resConfigs "en" // english only releases } } 

Any simple idea how I can achieve this?

+6
source share
1 answer

For some reason, individual buildType configurations do not support the resConfigs command, as you specify, but defaultConfig does, and then you can use this trick to manipulate it for each type of assembly, even if the settings are not configured:

 android { defaultConfig { resConfigs "en" } applicationVariants.all { variant -> if (variant.buildType.name.equals("debug")) { variant.mergedFlavor.resourceConfigurations.add("de") } } } 
+5
source

Source: https://habr.com/ru/post/975011/


All Articles