Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EventBus and Proguard: Could not dispatch event

I'm trying to export a signed app and when I run my app i get this exception

Could not dispatch event: class com.achlan.myapp.events.e to subscribing class class com.achlan.myapp.b.d

mapping.txt:

com.achlan.myapp.events.RestResult -> com.achlan.myapp.events.e
com.achlan.myapp.data.DataManager -> com.achlan.myapp.b.d:

I've already added this line to my proguard config:

-keepclassmembers class ** {
public void onEvent*(**); }

Am I missing something in my proguard config?

like image 335
Achlan Avatar asked Aug 27 '13 07:08

Achlan


1 Answers

I also had an issue with EventBus and ProGuard and I contacted the creator of ProGuard/DexGuard and he sent me the following 'workaround' which might help:

-keepclassmembers,includedescriptorclasses class ** { public void onEvent*(**); }

Add includedescriptorclasses to your config file to prevent ProGuard/DexGuard's optimization step to add a suffix to the method name.

like image 134
Steffen Avatar answered Nov 18 '22 21:11

Steffen