android debug包没有问题 release包有问题 org.greenrobot.eventbus.EventBusException: Subscriber class com.--Ac

报错如下:org.greenrobot.eventbus.EventBusException: Subscriber class com.--Activity and its super classes ...

如上问题需要在混淆文件规则(proguard-rules.pro)添加如下配置即可:

-keepattributes *Annotation*
-keepclassmembers class ** {
    @org.greenrobot.eventbus.Subscribe ;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }

# Only required if you use AsyncExecutor
-keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
    (java.lang.Throwable);
}

你可能感兴趣的:(android基础知识)