umano / AndroidSlidingUpPanel

This library provides a simple way to add a draggable sliding up panel (popularized by Google Music and Google Maps) to your Android application. Brought to you by Umano.
http://umano.me
Apache License 2.0
9.5k stars 2.27k forks source link

Error on ViewDragHelper clearMotionHistory. #631

Closed fbcbl closed 8 years ago

fbcbl commented 8 years ago

Fatal Exception: java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 at com.sothree.slidinguppanel.ViewDragHelper.clearMotionHistory(ViewDragHelper.java:792) at com.sothree.slidinguppanel.ViewDragHelper.shouldInterceptTouchEvent(ViewDragHelper.java:1037) at com.sothree.slidinguppanel.SlidingUpPanelLayout.onInterceptTouchEvent(SlidingUpPanelLayout.java:924) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2310) at com.sothree.slidinguppanel.SlidingUpPanelLayout.dispatchTouchEvent(SlidingUpPanelLayout.java:947) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2709) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2425) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2709) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2425) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2709) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2425) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2709) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2425) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2709) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2425) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2709) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2425) at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2568) at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1776) at android.app.Activity.dispatchTouchEvent(Activity.java:2866) at android.support.v7.internal.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:60) at android.support.v7.internal.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:60) at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2529) at android.view.View.dispatchPointerEvent(View.java:9186) at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4706) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4544) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4068) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4121) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4087) at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4201) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4095) at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4258) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4068) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4121) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4087) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4095) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4068) at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6564) at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6454) at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6425) at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6654) at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185) at android.os.MessageQueue.nativePollOnce(MessageQueue.java) at android.os.MessageQueue.next(MessageQueue.java:143) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:5951) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)

WonderCsabo commented 8 years ago

I am also seeing this in reports in Crashlytics. Any fix for this one?

fbcbl commented 8 years ago

No solution until this moment

fbcbl commented 8 years ago

@WonderCsabo did you found any workaround for this? I'm pretty desperate because this crash keeps happening and I don't know how to replicate it.

WonderCsabo commented 8 years ago

Unfortunately not.

tokudu commented 8 years ago

I'll look into it.

tokudu commented 8 years ago

What version of the library are you using? The stacktrace seems outdated.

WonderCsabo commented 8 years ago

I am using the latest version, 3.2.1.

This is the trace what i am seeing:

Fatal Exception: java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
       at com.sothree.slidinguppanel.ViewDragHelper.clearMotionHistory(ViewDragHelper.java:828)
       at com.sothree.slidinguppanel.ViewDragHelper.shouldInterceptTouchEvent(ViewDragHelper.java:1073)
       at com.sothree.slidinguppanel.SlidingUpPanelLayout.onInterceptTouchEvent(SlidingUpPanelLayout.java:942)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2108)
       at com.sothree.slidinguppanel.SlidingUpPanelLayout.dispatchTouchEvent(SlidingUpPanelLayout.java:1035)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
       at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2403)
       at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1737)
       at android.app.Activity.dispatchTouchEvent(Activity.java:2771)
       at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:60)
       at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:60)
       at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2364)
       at android.view.View.dispatchPointerEvent(View.java:9520)
       at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4230)
       at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4096)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
       at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3787)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3669)
       at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3844)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3669)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
       at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5922)
       at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5896)
       at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5857)
       at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6025)
       at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:323)
       at android.os.Looper.loop(Looper.java:135)
       at android.app.ActivityThread.main(ActivityThread.java:5417)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
fbcbl commented 8 years ago

I'm with the 3.2.0 and seeing that error. Will update to the 3.2.1 soon to production (where I'm seeing those crashes). Thank you for looking into this, this is a delicate crash in our app.

tokudu commented 8 years ago

Fixed in https://github.com/umano/AndroidSlidingUpPanel/commit/b4baf27e4ce31531e7479f6f7c9811afb2649cd2