Strange Null Pointer Causing Crash #65

Closed
gflarity opened this Issue Sep 16, 2013 · 4 comments

Comments

Projects
None yet
2 participants

We just updated to 1.1.8, forget the previous version. We've had some crashes and are a bit confused by why they're happening. Any help would be much appreciated, so far we're really enjoying this lib.

Here's the stack, logcat is below.

java.lang.RuntimeException: Unable to destroy activity {com.avidtap.pos/com.avidtap.pos.MainActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3451)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3469)
at android.app.ActivityThread.access$1200(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1287)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.koushikdutta.async.http.socketio.SocketIOConnection.disconnect(SocketIOConnection.java:79)
at com.koushikdutta.async.http.socketio.SocketIOClient.disconnect(SocketIOClient.java:176)
at com.avidtap.pos.socketio.SocketIOBroadcast.disconnect(SocketIOBroadcast.java:126)
at com.avidtap.pos.MainActivity.onDestroy(MainActivity.java:345)
at android.app.Activity.performDestroy(Activity.java:5273)
at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1110)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3438)
... 11 more
java.lang.NullPointerException
at com.koushikdutta.async.http.socketio.SocketIOConnection.disconnect(SocketIOConnection.java:79)
at com.koushikdutta.async.http.socketio.SocketIOClient.disconnect(SocketIOClient.java:176)
at com.avidtap.pos.socketio.SocketIOBroadcast.disconnect(SocketIOBroadcast.java:126)
at com.avidtap.pos.MainActivity.onDestroy(MainActivity.java:345)
at android.app.Activity.performDestroy(Activity.java:5273)
at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1110)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3438)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3469)
at android.app.ActivityThread.access$1200(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1287)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)

09-16 09:27:18.730 D/ProductSelectorFragment( 1274): onResume 1108860712
09-16 09:27:18.850 D/ProductSelectorFragment( 1274): show all products initially 1108860712
09-16 09:27:19.200 D/ProductSelectorFragment( 1274): First category spinner click came in! Intercepting with last known category position: 2
09-16 09:27:19.420 D/ProductSelectorFragment( 1274): onItemSelected 1108860712
09-16 09:27:19.440 E/NIO ( 1274): Unhandled exception
09-16 09:27:19.440 E/NIO ( 1274): java.net.SocketException: recvfrom failed: ETIMEDOUT (Connection timed out)
09-16 09:27:19.440 E/NIO ( 1274): at libcore.io.IoBridge.maybeThrowAfterRecvfrom(IoBridge.java:552)
09-16 09:27:19.440 E/NIO ( 1274): at libcore.io.IoBridge.recvfrom(IoBridge.java:528)
09-16 09:27:19.440 E/NIO ( 1274): at java.nio.SocketChannelImpl.readImpl(SocketChannelImpl.java:314)
09-16 09:27:19.440 E/NIO ( 1274): at java.nio.SocketChannelImpl.read(SocketChannelImpl.java:276)
09-16 09:27:19.440 E/NIO ( 1274): at com.koushikdutta.async.SocketChannelWrapper.read(SocketChannelWrapper.java:24)
09-16 09:27:19.440 E/NIO ( 1274): at com.koushikdutta.async.AsyncNetworkSocket.onReadable(AsyncNetworkSocket.java:152)
09-16 09:27:19.440 E/NIO ( 1274): at com.koushikdutta.async.AsyncServer.runLoop(AsyncServer.java:728)
09-16 09:27:19.440 E/NIO ( 1274): at com.koushikdutta.async.AsyncServer.run(AsyncServer.java:590)
09-16 09:27:19.440 E/NIO ( 1274): at com.koushikdutta.async.AsyncServer.access$600(AsyncServer.java:38)
09-16 09:27:19.440 E/NIO ( 1274): at com.koushikdutta.async.AsyncServer$14.run(AsyncServer.java:538)
09-16 09:27:19.440 E/NIO ( 1274): Caused by: libcore.io.ErrnoException: recvfrom failed: ETIMEDOUT (Connection timed out)
09-16 09:27:19.440 E/NIO ( 1274): at libcore.io.Posix.recvfromBytes(Native Method)
09-16 09:27:19.440 E/NIO ( 1274): at libcore.io.Posix.recvfrom(Posix.java:131)
09-16 09:27:19.440 E/NIO ( 1274): at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:159)
09-16 09:27:19.440 E/NIO ( 1274): at libcore.io.IoBridge.recvfrom(IoBridge.java:525)
09-16 09:27:19.440 E/NIO ( 1274): ... 8 more
09-16 09:27:20.920 D/UpdateEventHandler( 1274): can't resolve host
09-16 09:27:27.180 V/SlidingMenu( 1274): changing layerType. hardware? true
09-16 09:27:27.180 V/SlidingMenu( 1274): changing layerType. hardware? true
09-16 09:27:27.530 V/SlidingMenu( 1274): changing layerType. hardware? false
09-16 09:27:30.840 D/ProductSelectorFragment( 1274): onPause 1108860712
09-16 09:27:31.010 D/OnBootReceiver( 1274): already scheduled
09-16 09:27:31.040 D/ProductSelectorFragment( 1274): onResume 1105650264
09-16 09:27:31.120 D/ProductSelectorFragment( 1274): show all products initially 1105650264
09-16 09:27:31.310 V/CustomViewBehind( 1274): behind INVISIBLE
09-16 09:27:31.360 D/UpdateEventHandler( 1274): can't resolve host
09-16 09:27:31.460 D/ProductSelectorFragment( 1274): First category spinner click came in! Intercepting with last known category position: 2
09-16 09:27:31.590 D/ProductSelectorFragment( 1274): onItemSelected 1105650264
09-16 09:27:32.360 D/AndroidRuntime( 1274): Shutting down VM
09-16 09:27:32.360 W/dalvikvm( 1274): threadid=1: thread exiting with uncaught exception (group=0x41873930)
09-16 09:27:32.360 E/ACRA ( 1274): ACRA caught a RuntimeException exception for com.avidtap.pos. Building report.
09-16 09:27:32.360 D/ACRA ( 1274): Using default Report Fields
09-16 09:27:32.530 D/dalvikvm( 1274): GC_CONCURRENT freed 1817K, 20% free 7662K/9572K, paused 5ms+25ms, total 146ms
09-16 09:27:32.970 I/ACRA ( 1274): READ_LOGS granted! ACRA can include LogCat and DropBox data.
09-16 09:27:33.000 D/ACRA ( 1274): Retrieving logcat output...

Owner

koush commented Sep 16, 2013

Taking a look

Owner

koush commented Sep 16, 2013

This may fix it, let me know:

28a4b95

Owner

koush commented Sep 16, 2013

And this:

a904da4

Thanks! Not sure how to reproduce this error to be honest, but we'll deploy these changes asap.

GF

koush closed this Sep 16, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment