美文网首页Android
EventBus混淆的坑

EventBus混淆的坑

作者: 我乐你不乐 | 来源:发表于2018-07-26 17:07 被阅读0次

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混淆的坑

    本文链接:https://www.haomeiwen.com/subject/uzgbmftx.html