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

ArrayIndexOutOfBoundsException in Android #2196

Closed
williamliangwl opened this issue Aug 31, 2022 · 3 comments
Closed

ArrayIndexOutOfBoundsException in Android #2196

williamliangwl opened this issue Aug 31, 2022 · 3 comments
Labels
Close when stale The issue will be closed automatically if it remains inactive Missing repro Platform: Android This issue is specific to Android

Comments

@williamliangwl
Copy link

williamliangwl commented Aug 31, 2022

Description

We just upgraded to RN 0.69.4 also with react-native-gesture-handler upgraded to 2.5.0 from 1.10.3. Upon releasing the app in Play Store, we are starting to see the following crash message. The length and index is not always the same, but the stack trace is consistent.

We are seeing this error happening more on low-end, Android 8 - 9 devices. The pages where this happens (guessed based on the Firebase Crashlytics log) are different between each crash reports.

Fatal Exception: java.lang.ArrayIndexOutOfBoundsException: length=3; index=3
       at java.util.ArrayList.clear(ArrayList.java:569)
       at android.view.ViewGroup.buildOrderedChildList(ViewGroup.java:4363)
       at android.view.ViewGroup.buildTouchDispatchChildList(ViewGroup.java:2753)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2593)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at com.swmansion.gesturehandler.react.RNGestureHandlerRootView.dispatchTouchEvent(RNGestureHandlerRootView.kt:39)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at com.swmansion.gesturehandler.react.RNGestureHandlerRootView.dispatchTouchEvent(RNGestureHandlerRootView.kt:39)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at com.swmansion.gesturehandler.react.RNGestureHandlerRootView.dispatchTouchEvent(RNGestureHandlerRootView.kt:39)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3049)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
       at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:601)
       at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1980)
       at android.app.Activity.dispatchTouchEvent(Activity.java:3380)
       at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
       at io.sentry.android.core.internal.gestures.WindowCallbackAdapter.dispatchTouchEvent(WindowCallbackAdapter.java:39)
       at io.sentry.android.core.internal.gestures.SentryWindowCallback.dispatchTouchEvent(SentryWindowCallback.java:64)
       at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:557)
       at android.view.View.dispatchPointerEvent(View.java:12123)
       at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5119)
       at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4910)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4404)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4474)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4432)
       at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4574)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4440)
       at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4631)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4404)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4474)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4432)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4440)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4404)
       at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7070)
       at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7044)
       at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6995)
       at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7195)
       at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:195)
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:333)
       at android.os.Looper.loop(Looper.java:150)
       at android.app.ActivityThread.main(ActivityThread.java:6759)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:875)

Steps to reproduce

We can't reproduce this easily as it happens randomly

Snack or a link to a repository

it's private repository

Gesture Handler version

2.5.0

React Native version

0.69.4

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Release mode

Device

Real device

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added the Platform: Android This issue is specific to Android label Aug 31, 2022
@github-actions
Copy link

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@williamliangwl
Copy link
Author

I will try to add the patch mentioned here and see if the error still happens, but still it is a patch, might not be the solution

@j-piasecki
Copy link
Member

I'm afraid, I won't be able to help you in this case without a reliable reproduction. The only Gesture Handler class in the stack trace is RNGestureHandlerRootView which is responsible only for intercepting events and passing them further, and since the crash was caused by calling clear on and ArrayList it doesn't give much information.

@j-piasecki j-piasecki added the Close when stale The issue will be closed automatically if it remains inactive label Sep 14, 2022
@github-actions github-actions bot closed this as completed Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Close when stale The issue will be closed automatically if it remains inactive Missing repro Platform: Android This issue is specific to Android
Projects
None yet
Development

No branches or pull requests

2 participants