How can I override the resConfigs
per build types? I read that flavors would allow that, but I don't use them. I just want for my debug 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 that?
Understand build configurations. You can store different configurations of solution and project properties to use in different kinds of builds. To create, select, modify, or delete a configuration, you can use the Configuration Manager. To open it, on the menu bar, choose Build > Configuration Manager, or just type Configuration in the search box.
The project configuration determines what build settings and compiler options are used when you build the project. To create, select, modify, or delete a configuration, you can use the Configuration Manager. To open it, on the menu bar, choose Build > Configuration Manager, or just type Configuration in the search box.
If you want to build multiple configurations and platforms in one action, you can use the Build > Batch Build option in Visual Studio. To access this feature, press Ctrl + Q to open the search box, and enter Batch build.
Build configurations are defined by a BuildConfig, which is a REST object that can be used in a POST to the API server to create a new instance. A build configuration, or BuildConfig, is characterized by a build strategyand one or more sources.
For some reason the individual buildType configs doesn't support the resConfigs
command as you point out, but defaultConfig
does and then you can use this trick to manipulate it per build type even without flavors configured:
android {
defaultConfig {
resConfigs "en"
}
applicationVariants.all { variant ->
if (variant.buildType.name.equals("debug")) {
variant.mergedFlavor.resourceConfigurations.add("de")
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With