EventBus Producer 已经失效,不能再生产事件
EventBus Producer has been invalidated and can no longer produce events
我正在使用 RxBus,它是 Otto/EventBus 的 RxJava 克隆,用于在我的 android 应用程序的不同组件之间进行通信。该应用程序在我的摩托罗拉 Moto x 2013 运行 ICS 上运行良好,没有崩溃。但是在 Nexus 5X 上,运行 Android M,它抛出这个异常:
Fatal Exception: java.lang.IllegalStateException: Exception thrown on Scheduler.Worker thread. Add `onError` handling.
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:60)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5333)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by rx.exceptions.OnErrorNotImplementedException: [EventProducer public xyz.chanl.radio.events.Events$StageProgram xyz.chanl.radio.fragments.ProgramListFragment.stageProgram()] has been invalidated and can no longer produce events.
at rx.Observable.onError(Observable.java:8139)
at rx.observers.SafeSubscriber._onError(SafeSubscriber.java:157)
at rx.observers.SafeSubscriber.onError(SafeSubscriber.java:120)
at rx.internal.operators.OperatorSubscribeOn.onError(OperatorSubscribeOn.java:59)
at rx.Observable.unsafeSubscribe(Observable.java:8321)
at rx.internal.operators.OperatorSubscribeOn.call(OperatorSubscribeOn.java:94)
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5333)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by java.lang.IllegalStateException: [EventProducer public xyz.chanl.radio.events.Events$StageProgram xyz.chanl.radio.fragments.ProgramListFragment.stageProgram()] has been invalidated and can no longer produce events.
at com.hwangjr.rxbus.entity.ProducerEvent.produceEvent(ProducerEvent.java:98)
at com.hwangjr.rxbus.entity.ProducerEvent.access[=10=]0(ProducerEvent.java:17)
at com.hwangjr.rxbus.entity.ProducerEvent.call(ProducerEvent.java:80)
at com.hwangjr.rxbus.entity.ProducerEvent.call(ProducerEvent.java:76)
at rx.Observable.unsafeSubscribe(Observable.java:8314)
at rx.internal.operators.OperatorSubscribeOn.call(OperatorSubscribeOn.java:94)
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5333)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
at dalvik.system.NativeStart.main(NativeStart.java)
我用谷歌搜索过,但之前似乎没有人遇到过这个问题,或者我找不到一个非常相似的堆栈跟踪。
我该如何调查这个问题?
我register
和unregister
总线在onStart
和onStop
函数片段。
因此,我进行了调查,发现这通常发生在注册多个生产者发出相同事件时。因此,当生产者注册了一个特定事件时,它会使第二个事件无效。不知道这个设计是不是故意的
我正在使用 RxBus,它是 Otto/EventBus 的 RxJava 克隆,用于在我的 android 应用程序的不同组件之间进行通信。该应用程序在我的摩托罗拉 Moto x 2013 运行 ICS 上运行良好,没有崩溃。但是在 Nexus 5X 上,运行 Android M,它抛出这个异常:
Fatal Exception: java.lang.IllegalStateException: Exception thrown on Scheduler.Worker thread. Add `onError` handling.
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:60)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5333)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by rx.exceptions.OnErrorNotImplementedException: [EventProducer public xyz.chanl.radio.events.Events$StageProgram xyz.chanl.radio.fragments.ProgramListFragment.stageProgram()] has been invalidated and can no longer produce events.
at rx.Observable.onError(Observable.java:8139)
at rx.observers.SafeSubscriber._onError(SafeSubscriber.java:157)
at rx.observers.SafeSubscriber.onError(SafeSubscriber.java:120)
at rx.internal.operators.OperatorSubscribeOn.onError(OperatorSubscribeOn.java:59)
at rx.Observable.unsafeSubscribe(Observable.java:8321)
at rx.internal.operators.OperatorSubscribeOn.call(OperatorSubscribeOn.java:94)
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5333)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by java.lang.IllegalStateException: [EventProducer public xyz.chanl.radio.events.Events$StageProgram xyz.chanl.radio.fragments.ProgramListFragment.stageProgram()] has been invalidated and can no longer produce events.
at com.hwangjr.rxbus.entity.ProducerEvent.produceEvent(ProducerEvent.java:98)
at com.hwangjr.rxbus.entity.ProducerEvent.access[=10=]0(ProducerEvent.java:17)
at com.hwangjr.rxbus.entity.ProducerEvent.call(ProducerEvent.java:80)
at com.hwangjr.rxbus.entity.ProducerEvent.call(ProducerEvent.java:76)
at rx.Observable.unsafeSubscribe(Observable.java:8314)
at rx.internal.operators.OperatorSubscribeOn.call(OperatorSubscribeOn.java:94)
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5333)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
at dalvik.system.NativeStart.main(NativeStart.java)
我用谷歌搜索过,但之前似乎没有人遇到过这个问题,或者我找不到一个非常相似的堆栈跟踪。
我该如何调查这个问题?
我register
和unregister
总线在onStart
和onStop
函数片段。
因此,我进行了调查,发现这通常发生在注册多个生产者发出相同事件时。因此,当生产者注册了一个特定事件时,它会使第二个事件无效。不知道这个设计是不是故意的