6

I added the following line in my proguard config:

 -keep class com.mypackage.** {*;}

But now proguard doesn't remove my class com.mypackage.BuildConfig.class from the result. And I want it to be removed.

How can I exclude a given class from being kept?

Thanks

Addev
  • 31,819
  • 51
  • 183
  • 302
  • The `keep` option is used to ask proguard to keep some elements (packages, classes, methods, ...). If you don't want to keep that class, you should remove that statement or refine it if you want a more fine-grained control. – manfcas Dec 09 '16 at 15:28

1 Answers1

14

You can use the following rule:

-keep class !com.mypackage.BuildConfig, com.mypackage.** { *; }
T. Neidhart
  • 6,060
  • 2
  • 15
  • 38