Android 绿色机器人事件总线

Android 绿色机器人事件总线,android,proguard,android-proguard,greenrobot-eventbus,Android,Proguard,Android Proguard,Greenrobot Eventbus,我正在我的应用程序上使用事件总线。下面是我添加的 # Green Robot Eventbus -keepattributes *Annotation* -keepclassmembers class ** { @org.greenrobot.eventbus.Subscribe <methods>; } -keep enum org.greenrobot.eventbus.ThreadMode { *; } 我的应用程序在调试版本中运行良好。也许这是我缺少的东西我所有的订

我正在我的应用程序上使用事件总线。下面是我添加的

# Green Robot Eventbus
-keepattributes *Annotation*
-keepclassmembers class ** {
    @org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }

我的应用程序在调试版本中运行良好。也许这是我缺少的东西

我所有的订阅注释方法都定义为
void methodName(…)
我发现我必须显式添加
public
,以便在发布版本上正确工作

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