# In your library's consumer-proguard-rules.pro -keep, allowoptimization class ** implements com.example.mylibrary.MyWorker { (); ; } -whyareyoukeeping class com.example.mylibrary.MyWorker{ ; } -keepattributes RuntimeVisibleAnnotations -keep @interface com.example.mylibrary.OnEvent -keepclasseswithmembers class **{ (); @com.example.mylibrary.OnEvent ; } -keep class com.example.mylibrary.EventBus { ; } -whyareyoukeeping class com.example.mylibrary.EventBus { ; ; } -keep @interface com.example.mylibrary.ReflectiveExecutor -keep @com.example.mylibrary.ReflectiveExecutor class **{ # Keep the public, no-argument constructor so that an instance of the class can be created. # is the internal name for a constructor. public (); # Keep the public execute() method that has no parameters. # This is critical because TaskRunner calls getMethod("execute"). # If this method is renamed (obfuscated) or removed # (shrunk), your app wont work the intended way. public void execute(); }