Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pointerIndex out of range #46

Open
vytautokas opened this issue Feb 8, 2018 · 5 comments
Open

pointerIndex out of range #46

vytautokas opened this issue Feb 8, 2018 · 5 comments

Comments

@vytautokas
Copy link

Fatal Exception: java.lang.IllegalArgumentException: pointerIndex out of range
at android.view.MotionEvent.nativeGetAxisValue(MotionEvent.java)
at android.view.MotionEvent.getY(MotionEvent.java:2431)
at android.support.v4.view.MotionEventCompat.getY(MotionEventCompat.java:521)
at com.baoyz.widget.PullRefreshLayout.onTouchEvent(PullRefreshLayout.java:324)
at android.view.View.dispatchTouchEvent(View.java:10920)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2810)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2512)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2527)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2527)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2527)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2527)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2527)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2527)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2527)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2527)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2527)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.cancelAndClearTouchTargets(ViewGroup.java:2662)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2368)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2842)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2469)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:623)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1906)
at android.app.Activity.dispatchTouchEvent(Activity.java:3247)
at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:68)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:585)
at android.view.View.dispatchPointerEvent(View.java:11149)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5227)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5076)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4580)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4633)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4599)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4736)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4607)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4793)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4580)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4633)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4599)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4607)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4580)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7210)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7142)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7103)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7321)
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:136)
at android.app.ActivityThread.main(ActivityThread.java:6823)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)

@endy-s
Copy link

endy-s commented Feb 16, 2018

Got this too.
It was reported by Crashlytics in the production app, so I'm not sure how to reproduce it.

@endy-s
Copy link

endy-s commented Feb 16, 2018

having in mind the log, it seems to be related to the ACTION_CANCEL part of the onTouchEvent method.

Probably changing the code at line 324 to:

if (pointerIndex > -1 && MotionEventCompat.getPointerCount(ev)) {
    final float y = MotionEventCompat.getY(ev, pointerIndex);
    ... continue the processing ...
} else {
    return false;
}

Will prevent this kind of crash to happen.

I know you don't commit nothing to this repo since 2015 @baoyongzhang , but it would be great if you just add this preventing line :)

Thanks in advance!

@vytautokas
Copy link
Author

Is there any possibility that issue will be solved ?

@Spettacolo83
Copy link

I got the same error too.
Please @baoyongzhang can you fix the code as @endy-s suggested.
It would be great!
Thank you for your library though!

@Spettacolo83
Copy link

Any news? I'm still getting this error in production?
Can we help you to fix this issue? Let us know!
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants