0

I'm using RoboGuice's EventManager in my app as shown here https://code.google.com/p/roboguice/wiki/Events#Creating_your_Own_Events

and it works perfectly in debug build, but the events do not trigger in release build - probably due to ProGuard obfuscation.

I tried to keep the relevant methods and classes from ProGuard's handling, but I guess I'm doing something wrong:

This is what I tried ProGuard config

-keep class com.myapp.events.*                          # keep all the event classes
-keepclasseswithmembers class * { void on*Event(*); }   # keep methods named on*Event,  eg. onUserClickedEvent

my main activity class has handlers such as:

public void onUserClickedEvent( @Observes UserClicked  event) {
    ...
}
Iftah
  • 9,512
  • 2
  • 33
  • 45

1 Answers1

0

Solved after reading more about Proguard... I changed functions signature and modified the Proguard config to this:

-keep class com.myapp.events.*  
-keepclasseswithmembers class * { 
   void onEvent*(...); 
}
Iftah
  • 9,512
  • 2
  • 33
  • 45