Home » Android » build.gradle – how to package only default language with android gradle resConfigs

build.gradle – how to package only default language with android gradle resConfigs

Posted by: admin May 14, 2020 Leave a comment

Questions:

I know how to restrict language support using resConfigs :

defaultConfig {
    ...
    resConfig "en"
}

But how to restrict language to support only the default one (in values/ folder) ? Is there a way to avoid packaging any language resources stored in values-xx/ folders ?

Thanks

How to&Answers:

You can do this by specifying the exclude on the filter field:

android {
    sourceSets.main.res.filter.exclude '**/values/whatever.xml'
}