java - GreenRobot Exception : de.greenrobot.event.EventBusException: Invoking subscriber failed -
time time exception.
i use green-robot standard way, between views, fragments, activities, services , app, default instance, , time time stickyevents.
i did't find other post related exception. idea, or hint start investigation ?
the event bus working nicely (~ 20 events, 10 subscribers), user triggered no big workload in field.
the complete stack-trace here :
de.greenrobot.event.eventbusexception: invoking subscriber failed 10-27 15:37:00.522 25414-25414/fr.tech.app..u e/androidruntime: @ de.greenrobot.event.eventbus.handlesubscriberexception(eventbus.java:518) 10-27 15:37:00.522 25414-25414/fr.tech.app..u e/androidruntime: @ de.greenrobot.event.eventbus.invokesubscriber(eventbus.java:500) 10-27 15:37:00.522 25414-25414/fr.tech.app..u e/androidruntime: @ de.greenrobot.event.eventbus.posttosubscription(eventbus.java:429) 10-27 15:37:00.522 25414-25414/fr.tech.app..u e/androidruntime: @ de.greenrobot.event.eventbus.postsingleeventforeventtype(eventbus.java:410) 10-27 15:37:00.522 25414-25414/fr.tech.app..u e/androidruntime: @ de.greenrobot.event.eventbus.postsingleevent(eventbus.java:383) 10-27 15:37:00.522 25414-25414/fr.tech.app..u e/androidruntime: @ de.greenrobot.event.eventbus.post(eventbus.java:263) 10-27 15:37:00.522 25414-25414/fr.tech.app..u e/androidruntime: @ fr.u.app.u.dialog.tastingnavigationdialog$1.onselection(tastingnavigationdialog.java:42)
error triggered materialdialog instance :
dialogbuilder = new materialdialog.builder(context) .title(r.string.dialogtastingnavigationtriptitle) .negativetext(r.string.buttoncancel) .cancelable(false) .adapter(listadapter, new materialdialog.listcallback() { @override public void onselection(materialdialog dialog, view itemview, int which, charsequence text) { eventbus.getdefault().post(new tastingpagetoevent(listadapter.list.get(which), which)); dialog.dismiss(); } });
edit
i found 1 thing trigger exception, posting 1 stickyevent 1 fragment. intended appearing fragment able sticky event.
when going eventbus source, stops @ :
void invokesubscriber(subscription subscription, object event) { try { subscription.subscribermethod.method.invoke(subscription.subscriber, event); } catch (invocationtargetexception e) { handlesubscriberexception(subscription, event, e.getcause()); } catch (illegalaccessexception e) { throw new illegalstateexception("unexpected exception", e); } }
edit
here scenario.
public class topevent { string name; public topevent(string name){ this.name = name; } } public class myevent extends topevent { string extrainfo; public myevent(string name, string extra){ super(name); this.extrainfo = extra; } }
here 1 fragment tx :
... eventbus.getdefault().poststickyevent(new myevent("stack","overflow"); ...
here second fragment rx
... string = eventbus.getdefault().getstickyevent(myevent.class).extrainfo; ...
here service (the 1 got strange behavior)
public class myservice extends service { ... eventbus.getdefault().registersticky(this) onevent(topevent event){ ... ... } }
at end of onevent, exception thrown. if hidden behavior sticky extended event (from super) posted triggers non-sticky event of super event.
this due eventbus configuration :
eventbus.builder().throwsubscriberexception(buildconfig.debug).installdefaulteventbus();
however have difficulties understand why option interesting. in fact (almost) see exception of subscriber failed, because there exception of subscriber. hidden. why interesting ?
Comments
Post a Comment