2016-11-08 70 views
1

我在我的應用程序上使用Event bus。繼docs我已經添加Proguard綠色機器人事件總線

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

<project>/app/proguard-rules.pro

但是,當編譯我的應用程序alsways得到錯誤

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 

我的應用程序幹活的調試釋放微粒。也許是我丟失的東西

回答

0

我所有的訂閱註釋的方法,如void methodName(...)定義,我發現爲了在發佈正確工作,我必須明確的添加public建立