As a library developer: how to avoid the user's Proguard

175 views Asked by At

I'm a library developer.

I'm experiencing issues with the users of my library regarding Proguard. Seems like their Proguard is messing the models of the library.

I have defined in the proguard-rules.pro file of the library, which are the packages and classes I don't want to shrink, as the following:

-keep class com.x.library.data.models.** {*;}

Seems like their Proguard shrinks everything anyways.

Is there a way to avoid their Proguard to shrink the library I develop? Thanks in advance.

1

There are 1 answers

0
Xavier Rubio Jansana On BEST ANSWER

You can use consumerProguardFiles in your library defaultConfig to specify a Proguard rules file that will get merged with the one in the app.

See also the following questions: