1
我发布了一些事件和订阅的代码在调试apk上正常工作,但当我使用我的密钥存储库签署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);
}
也许尝试在自己的自定义POJO包裹'String'。 (用一个getter来创建一个类型为String的1字段的简单类)。看看它是否有所作为。 – Vucko
你在发布版本中使用proguard吗? – Muthu
是的。我明白了.. –