EventBus Producer has been invalidated and can no longer produce events - android

I am using RxBus which is an RxJava clone of Otto/EventBus to communicate between the different components of my android app. The app works fine on my Motorola Moto x 2013 running ICS, without crashes. But on a Nexus 5X, running Android M, it throws this exception:
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$27.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$1$1.onError(OperatorSubscribeOn.java:59)
at rx.Observable.unsafeSubscribe(Observable.java:8321)
at rx.internal.operators.OperatorSubscribeOn$1.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$000(ProducerEvent.java:17)
at com.hwangjr.rxbus.entity.ProducerEvent$1.call(ProducerEvent.java:80)
at com.hwangjr.rxbus.entity.ProducerEvent$1.call(ProducerEvent.java:76)
at rx.Observable.unsafeSubscribe(Observable.java:8314)
at rx.internal.operators.OperatorSubscribeOn$1.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)
i have googled, but nobody seems to have had this issue before or i cant find an even remotely similar stacktrace.
How can i investigate this problem?
I register and unregister the bus in the onStart and onStop functions of the fragment.

So, I investigated and I realized this normally happens when you register multiple producers emitting the same event. So when the producer is registered with a particular event it invalidates the second one. I don't know if this design was intentional.

Related

java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider"

I Received a crash report on my developers console which I have some trouble figuring out. The crash is reported by a Android 4.4 device and it is reported with the recent update I published for my app. I've seen other topics here on Stackoverflow on the same issue but as far as I know all of them are with users that are exceding the 64k method limit. I Used the apk analyse tool in Android Studio and it states that my dex file contains around 29000 methods and 37000 references. Now I'm not sure if I need to add those numbers or if I only need to look at the 29000 method count to determine if I exceed the 64k limit. I did test the apk on a 4.4 emulator and I can install and run it without issue.
Can someone shed some light on this?
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4522)
at android.app.ActivityThread.access$1500(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1381)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5299)
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:836)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/mnt/asec2/[2]com.cubeactive.qnotelistfree-1/pkg.apk"],nativeLibraryDirectories=[/mnt/asec2/[2]com.cubeactive.qnotelistfree-1/lib, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.app.ActivityThread.installProvider(ActivityThread.java:5003)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4589)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4522)
at android.app.ActivityThread.access$1500(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1381)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5299)
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:836)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)
at dalvik.system.NativeStart.main(NativeStart.java)

Can I know how Activity was started by looking at crash stack trace?

I have a NPE and it seems that my Activity is started in some weird way/context as some components (constructed by dependency injection - dagger 2 - which are normally instantiated and working well) are null. All I have is call stack trace with NPE on top of it.
So can I say that my Activity was created/recreated in some special way by examining this:
//... and then all onCreate goes on and finally a NPE on top of it
at android.app.Activity.performCreate(Activity.java:5447)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2393)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2493)
at android.app.ActivityThread.access$800(ActivityThread.java:166)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5590)
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:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(NativeStart.java)

Exitting Libgdx App on Android Device

When I exit my game by Gdx.app.exit() on android device it gives me App has stopped message
Is this a proper way to exit a libgdx app ?
and Are assets disposed by this way ? I put Assets.dispose() in my game class dispose() method
It gives me this exception
java.lang.NullPointerException at com.badlogic.gdx.backends.android.AndroidInput.lookUpPointerIndex(AndroidInput.java:802) at com.badlogic.gdx.backends.android.AndroidMultiTouchHandler.onTouch(AndroidMultiTouchHandler.java:64) at com.badlogic.gdx.backends.android.AndroidInput.onTouch(AndroidInput.java:429) at android.view.View.dispatchTouchEvent(View.java:7793) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2287) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2027) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2287) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2027) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2287) at android.view.ViewGroup.cancelAndClearTouchTargets(ViewGroup.java:2128) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2686) at android.view.ViewRootImpl.dispatchDetachedFromWindow(ViewRootImpl.java:3201) at android.view.ViewRootImpl.doDie(ViewRootImpl.java:5810) at android.view.ViewRootImpl.die(ViewRootImpl.java:5783) at android.view.WindowManagerGlobal.removeViewLocked(WindowManagerGlobal.java:348) at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:303) at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:84) at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3776) at android.app.ActivityThread.access$1500(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1407) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:5345) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:828) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:644) at dalvik.system.NativeStart.main(Native Method)
The problem was in touchDown() method of InputListener which I used to addListener to exit button
I replaced it by clicked() of ClickListener and it solved the problem

Android: java.lang.NoSuchMethodError: Landroid\/os\/Handler when calling FacebookSdk.sdkInitialize()

I have an Android app used Facebook for login.
However, I got some user bug reports reporting "java.lang.NoSuchMethodError" when doing facebook initialization.
java.lang.NoSuchMethodError: Landroid\/os\/Handler;.
at android.support.v4.content.l.(LocalBroadcastManager.java:110)
at android.support.v4.content.k.(LocalBroadcastManager.java:110)
at android.support.v4.content.LocalBroadcastManager.getInstance(LocalBroadcastManager.java:102)
at com.facebook.internal.BoltsMeasurementEventListener.open(BoltsMeasurementEventListener.java:53)
at com.facebook.internal.BoltsMeasurementEventListener.getInstance(BoltsMeasurementEventListener.java:70)
at com.facebook.FacebookSdk.sdkInitialize(FacebookSdk.java:169)
at my.app.MyApplication.onCreate(MyApplication.java:119)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4464)
at android.app.ActivityThread.access$1500(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1306)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:212)
at android.app.ActivityThread.main(ActivityThread.java:5137)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:718)
at dalvik.system.NativeStart.main(Native Method)
What would be the possible cause of this issue?
I am too late to answer (Help to others) but I solved this problem and I am not sure if it can work for others too.
I added a release key hash together with the debug key hash in the developers.facebook.com/................
and it worked.
Lets see if it works for others too.

ArithmeticExcpetion in GridView

Hi All I am getting an ArithmeticException in my Google Play crash Reports. I am not able to reproduce it locally hence I have to rely on only these reports.
I am using the GridViews in my app, I am setting the Number of Columns manually instead of setting it to "auto_fit". I am not sure why this crash is happening.
The Following is the stack Trace, any help would be appreciated;
*
java.lang.ArithmeticException: divide by zero
at android.widget.GridView.onInitializeAccessibilityNodeInfo(GridView.java:2296)
at android.view.View.createAccessibilityNodeInfoInternal(View.java:5493)
at android.view.View.createAccessibilityNodeInfo(View.java:5480)
at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:811)
at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:834)
at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchAccessibilityNodeInfos(AccessibilityInteractionController.java:720)
at android.view.AccessibilityInteractionController.findAccessibilityNodeInfoByAccessibilityIdUiThread(AccessibilityInteractionController.java:147)
at android.view.AccessibilityInteractionController.access$300(AccessibilityInteractionController.java:49)
at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage(AccessibilityInteractionController.java:971)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5748)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
*
Thanks and Regards,
Shashi Kiran G M

Categories

Resources