0

Suppose I have the following resources in my Android project:

  • res/values/strings.xml
  • res/values-land/strings.xml

I would like to exclude the resources defined for land qualifier from packaging into apk. Is there such a possibility? And, no, I can not just remove the res/values-land/, as it's required for some flavors.

I tried several options, like using the sourceSets.main.res.filter.exclude or packagingOptions, but no success.

Vit Khudenko
  • 28,288
  • 10
  • 63
  • 91
  • 1
    "as it's required for some flavors." - so add it just to those flavors? – ianhanniballake Dec 19 '22 at 23:38
  • @ianhanniballake, it's long story, but I can't due to other reasons. – Vit Khudenko Dec 20 '22 at 09:58
  • Can you explain those reasons? – ianhanniballake Dec 20 '22 at 14:58
  • @ianhanniballake, I agree with you the request sounds odd and it implies there's a deeper root issue. It would be right to declare alternative resources for those flavors, but the project is big and this kind of refactoring would take a lot of time, so I got a request to investigate this option as the most cheap workaround. Looks like there is no support in AGP out of the box (I don't consider crazy ways to do that), so we'll apply a true way as you mentioned. – Vit Khudenko Dec 23 '22 at 14:41

0 Answers0