Is there a reasonably simple way for a module\'s build.gradle file to indicate that certain files from a dependency should be excluded? I am specifically intere
I believe you can solve this problem more elegantly using the PackagingOptions facility of the Android Gradle Plugin DSL.
I was able to use this myself to exclude some native libraries I didn't need introduced by an AAR in my project.
android {
...
packagingOptions {
exclude '/lib/armeabi-v7a/'
}
}
For the case outlined in the question, I believe this would work:
android {
...
packagingOptions {
exclude '/res/values-v21/'
}
}