EventBus混淆的坑

de.greenrobot.event.EventBusException: Subscriber class xxx  and its super classes have no public methods with the @Subscribe annotation

网上找了混淆的方法,听说是官网的,然并卵

-keepattributes *Annotation* 

-keepclassmembers class ** { 

@org.greenrobot.eventbus.Subscribe ; 

-keep enum org.greenrobot.eventbus.ThreadMode { *; } 

最后经过对比发现,原来是多个版本的包名不一致

beta1版本的包名:de.greenrobot.event 

而正是3.0版本的包名是:org.greenrobot.eventbus

所以不要盲目复制网上给的混淆配置,先看下你用的eventbus版本和包名

你可能感兴趣的:(EventBus混淆的坑)