Can I exclude regional resources (e.g. values-fr) when building a particular Android Product Flavor with gradle

好久不见. 提交于 2019-11-29 07:03:48

The final working solution is to include a language - in this case, only German (de):

productFlavors {
    flavour3 {
        resConfigs 'de' // include '-de' resources, along with default 'values'
    }
}

As a reference, you can also check the list of country codes from ICU here.

You can exclude those folders by using this snippet:

sourceSets {
  flavor3 {
    main {
      resources {
        srcDir 'res'
        exclude '**/values-fr/**'
      }
    }
  }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!