[Android] Crash from com.twitter.sdk.android.tweetui.GalleryActivity

android
crash

#1

Hi!

We have some crashes in Crashlytics, with this stacktrace:

>     java.lang.IllegalArgumentException: pointerIndex out of range
                                                         at android.view.MotionEvent.nativeGetAxisValue(Native Method)
                                                         at android.view.MotionEvent.getX(MotionEvent.java:2072)
                                                         at android.support.v4.view.ViewPager.onInterceptTouchEvent(ViewPager.java:2092)
                                                         at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2108)
                                                         at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555)
                                                         at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
                                                         at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555)
                                                         at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
                                                         at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2555)
                                                         at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
                                                         at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2445)
                                                         at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent_aroundBody0(PhoneWindow.java:1756)
                                                         at com.android.internal.policy.PhoneWindow$AjcClosure1.run(PhoneWindow.java:1)
                                                         at android.view.PhoneWindowAO.ajc$around$android_view_PhoneWindowAO$2$99ce526bproceed(PhoneWindowAO.aj:113)
                                                         at android.view.PhoneWindowAO.ajc$around$android_view_PhoneWindowAO$2$99ce526b(PhoneWindowAO.aj:117)
                                                         at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1756)
                                                         at android.app.Activity.dispatchTouchEvent(Activity.java:2800)
                                                         at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2406)
                                                         at android.view.View.dispatchPointerEvent(View.java:9517)
                                                         at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4309)
                                                         at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4175)
                                                         at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3682)
                                                         at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3735)
                                                         at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3701)
                                                         at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3709)
                                                         at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3682)
                                                         at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3735)
                                                         at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3701)
                                                         at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3828)
                                                         at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3709)
                                                         at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3885)
                                                         at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3682)
                                                         at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3735)
                                                         at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3701)
                                                         at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3709)
                                                         at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3682)
                                                         at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6001)
                                                         at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5975)
                                                         at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5936)
                                                         at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6133)
                                                         at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
                                                         at android.os.MessageQueue.nativePollOnce(Native Method)
                                                         at android.os.MessageQueue.next(MessageQueue.java:323)
                                                         at android.os.Looper.loop(Looper.java:135)
                                                         at android.app.ActivityThread.main(ActivityThread.java:5525)
                                                         at java.lang.reflect.Method.invoke(Native Method)
                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)

And after some research I found out, that is a Android ViewPager bug, and there is hacky fix for it https://github.com/chrisbanes/PhotoView/issues/31#issuecomment-19803926

We already have this fix in our code, but there is also ViewPager in GalleryActivity from Twitter SDK, which one still crashes our app -> http://crashes.to/s/7c78630502d Currently this is #1 bug for us.

Could You implement previously mentioned fix in the Twitter SDK? You can check how to reproduce this crash in this video -> https://youtu.be/ZpWm1pog4WY

Greetings,
Peter


#2

Thank you for the detailed report. I will looks at getting this included in next release. Also what version of the support library are you using?


#3

Hi!
25.1.1 for sure. I will test it also on 25.2.0 tomorrow morning on dev branch.


#4

Hi!

There is still crash on 25.2.0.

Greetings,
Peter


#5

Thanks for the update. I will look into this more.


#6

Hi!

Any chance to fix this in the near future?


#7

This will be fixed in the next release of Twitter Kit.


#8