Remove assets from 3rd party library


I have a dependency from maven that I am using. Is there a possibility to remove the assets shipped with this .aar if I know which ones I would have to remove? How could I accomplish this? I want to remove those assets to reduce my APK size, but the resourceShrinker in Android doesn’t remove those assets.

Sounds like a use-case for artifact transforms: Gradle User Manual: Version 6.8.3

Thanks for your reply! I understand now the principle, but how would this look like in action? Once i have my Minify class which transforms the artifact, how would I use it? And I am also not sure, how to then use this transformed artifact in the project (sorry, I just have basic knowledge of Gradle)

It’s all described in the userguide.
The artifact transform transforms one set of attributes to another set of attributes.
On your consumer you configure on the resolvable configuration the attributes you want and then the transform is used to produce that variation.