我发布了一些事件,订阅的代码在调试 apk 上正常工作,但是当我用我的密钥库签署 apk 并安装应用程序时,相同的代码会崩溃。
java.lang.RuntimeException: Unable to start activity ComponentInfo
{com.example.friendz/com.example.friendz.shivaraj.activities.MainActivity}:
a.a.a.h: Subscriber class com.example.friendz.shivaraj.activities.MainActivity
and its super classes have no public methods with the @Subscribe annotation
但我的主要活动有定义了@Subscribe 的订阅者
我的活动中有此订阅者
@Subscribe
public void updateLocationEvent(String isStartLoc) {
Log.d("eventbuus", "stop event rcvd");
if (isStartLoc.equals("start")) {
startLocationUpdates();
} else {
stopLocationUpdates();
}
}
我正在像这样注册和注销
@Override
protected void onStart() {
super.onStart();
mGoogleApiClient.connect();
EventBus.getDefault().register(this);
}
@Override
protected void onStop() {
super.onStop();
EventBus.getDefault().unregister(this);
}