当前位置:   article > 正文

EventBus3.1.1 解决 Caused by: org.greenrobot.eventbus.EventBusException: Subscriber class ... and its ...

caused by: org.greenrobot.eventbus.eventbusexception: subscriber class com.y

      小菜今天自己写测试 Demo 时,需要用到 EventBus,目前集成 3.1.1 版本,集成的方式很简单,在某个 Fragment 实践应用中,却一直报入下错:
Caused by: org.greenrobot.eventbus.EventBusException: Subscriber class com.roating.ace.frag.FragmentSign and its super classes have no public methods with the @Subscribe annotation

      出问题就解决嘛,尝试如下:


  1. 检查 EventBus 集成是否添加混淆文件:
  1. -keepattributes *Annotation*
  2. -keepclassmembers class ** {
  3. @org.greenrobot.eventbus.Subscribe <methods>;
  4. }
  5. -keep enum org.greenrobot.eventbus.ThreadMode { *; }
  6. # Only required if you use AsyncExecutor
  7. -keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
  8. <init>(java.lang.Throwable);
  9. }
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/251243
推荐阅读
相关标签
  

闽ICP备14008679号