我在我的应用程序上使用事件总线。在我添加的文档之后
# Green Robot Eventbus
-keepattributes *Annotation*
-keepclassmembers class ** {
@org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }给我的<project>/app/proguard-rules.pro
但是,当编译我的应用程序时,总是会出现错误
ava.lang.RuntimeException: Unable to start activity ComponentInfo{com.rkmax.myapp.MyActivity}: org.greenrobot.eventbus.e: Subscriber class com.rkmax.myapp.MyActivity and its super classes have no public methods with the @Subscribe annotation我的应用程序在调试版本上做得很好。也许是我错过了什么
发布于 2016-11-08 03:43:18
我所有的订阅注释方法都是像void methodName(...)一样定义的,我发现我必须显式地添加public,这样才能在版本构建中正确地工作。
https://stackoverflow.com/questions/40478378
复制相似问题