react-native-gesture-handler: IllegalArgumentException pointerCount must be at least 1

Description

Crash reported by our crash analytics tool. Reason is unknown, but this library shows in the stack trace.

Screenshots

Stack trace:

java.lang.IllegalArgumentException pointerCount must be at least 1 
    MotionEvent.java:-2 android.view.MotionEvent.nativeInitialize
    MotionEvent.java:1706 android.view.MotionEvent.obtain
    MotionEvent.java:1752 android.view.MotionEvent.obtain
    GestureHandler.java:270 com.swmansion.gesturehandler.GestureHandler.adaptEvent
    GestureHandler.java:295 com.swmansion.gesturehandler.GestureHandler.handle
    GestureHandlerOrchestrator.java:301 com.swmansion.gesturehandler.GestureHandlerOrchestrator.deliverEventToGestureHandler
    GestureHandlerOrchestrator.java:259 com.swmansion.gesturehandler.GestureHandlerOrchestrator.deliverEventToGestureHandlers
    GestureHandlerOrchestrator.java:101 com.swmansion.gesturehandler.GestureHandlerOrchestrator.onTouchEvent
    RNGestureHandlerRootHelper.java:126 com.swmansion.gesturehandler.react.RNGestureHandlerRootHelper.dispatchTouchEvent
    RNGestureHandlerEnabledRootView.java:36 com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView.dispatchTouchEvent
    ViewGroup.java:3142 android.view.ViewGroup.dispatchTransformedTouchEvent
    ViewGroup.java:2834 android.view.ViewGroup.dispatchTouchEvent
    ViewGroup.java:3142 android.view.ViewGroup.dispatchTransformedTouchEvent
    ViewGroup.java:2834 android.view.ViewGroup.dispatchTouchEvent
    ViewGroup.java:3142 android.view.ViewGroup.dispatchTransformedTouchEvent
    ViewGroup.java:2834 android.view.ViewGroup.dispatchTouchEvent
    ViewGroup.java:3142 android.view.ViewGroup.dispatchTransformedTouchEvent
    ViewGroup.java:2834 android.view.ViewGroup.dispatchTouchEvent
    ViewGroup.java:3142 android.view.ViewGroup.dispatchTransformedTouchEvent
    ViewGroup.java:2834 android.view.ViewGroup.dispatchTouchEvent
    DecorView.java:495 com.android.internal.policy.DecorView.superDispatchTouchEvent
    PhoneWindow.java:1868 com.android.internal.policy.PhoneWindow.superDispatchTouchEvent
    Activity.java:4022 android.app.Activity.dispatchTouchEvent
    WindowCallbackWrapper.java:69 androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent
    DecorView.java:453 com.android.internal.policy.DecorView.dispatchTouchEvent
    View.java:14261 android.view.View.dispatchPointerEvent
    ViewRootImpl.java:5903 android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent
    ViewRootImpl.java:5706 android.view.ViewRootImpl$ViewPostImeInputStage.onProcess
    ViewRootImpl.java:5153 android.view.ViewRootImpl$InputStage.deliver
    ViewRootImpl.java:5206 android.view.ViewRootImpl$InputStage.onDeliverToNext
    ViewRootImpl.java:5172 android.view.ViewRootImpl$InputStage.forward
    ViewRootImpl.java:5180 android.view.ViewRootImpl$InputStage.apply
    ViewRootImpl.java:5153 android.view.ViewRootImpl$InputStage.deliver
    ViewRootImpl.java:5206 android.view.ViewRootImpl$InputStage.onDeliverToNext
    ViewRootImpl.java:5172 android.view.ViewRootImpl$InputStage.forward
    ViewRootImpl.java:5328 android.view.ViewRootImpl$AsyncInputStage.forward
    ViewRootImpl.java:5180 android.view.ViewRootImpl$InputStage.apply
    ViewRootImpl.java:5385 android.view.ViewRootImpl$AsyncInputStage.apply
    ViewRootImpl.java:5153 android.view.ViewRootImpl$InputStage.deliver
    ViewRootImpl.java:5206 android.view.ViewRootImpl$InputStage.onDeliverToNext
    ViewRootImpl.java:5172 android.view.ViewRootImpl$InputStage.forward
    ViewRootImpl.java:5180 android.view.ViewRootImpl$InputStage.apply
    ViewRootImpl.java:5153 android.view.ViewRootImpl$InputStage.deliver
    ViewRootImpl.java:8002 android.view.ViewRootImpl.deliverInputEvent
    ViewRootImpl.java:7969 android.view.ViewRootImpl.doProcessInputEvents
    ViewRootImpl.java:7930 android.view.ViewRootImpl.enqueueInputEvent
    ViewRootImpl.java:8156 android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent
    InputEventReceiver.java:189 android.view.InputEventReceiver.dispatchInputEvent
    InputEventReceiver.java:-2 android.view.InputEventReceiver.nativeConsumeBatchedInputEvents
    InputEventReceiver.java:179 android.view.InputEventReceiver.consumeBatchedInputEvents
    ViewRootImpl.java:8086 android.view.ViewRootImpl.doConsumeBatchedInput
    ViewRootImpl.java:8180 android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run
    Choreographer.java:1043 android.view.Choreographer$CallbackRecord.run
    Choreographer.java:866 android.view.Choreographer.doCallbacks
    Choreographer.java:794 android.view.Choreographer.doFrame
    Choreographer.java:1028 android.view.Choreographer$FrameDisplayEventReceiver.run
    Handler.java:883 android.os.Handler.handleCallback
    Handler.java:100 android.os.Handler.dispatchMessage
    Looper.java:214 android.os.Looper.loop
    ActivityThread.java:7615 android.app.ActivityThread.main
    Method.java:-2 java.lang.reflect.Method.invoke
    RuntimeInit.java:492 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run
    ZygoteInit.java:964 com.android.internal.os.ZygoteInit.main

Steps To Reproduce

Expected behavior

No crash.

Actual behavior

Random crash

Snack or minimal code example

I’m not using the library directly, but rather react-navigation is using it. However, the following code is used for initialization:

index.js

import 'react-native-gesture-handler';
... other imports and index code

MainActivity.java (as documented in the installation guide)

    /**
    For react-native-gesture-handler (used)
    */
    @Override
    protected ReactActivityDelegate createReactActivityDelegate() {
        return new ReactActivityDelegate(this, getMainComponentName()) {
            @Override
            protected ReactRootView createRootView() {
                return new RNGestureHandlerEnabledRootView(MainActivity.this);
            }
        };
    }

Package versions

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 9
  • Comments: 24 (5 by maintainers)

Commits related to this issue

Most upvoted comments

I’d be ok with merging a change that mitigates the issue. Seems like there are many people reporting it and no way for us to get a repro. Would suggest to make it so that it still crashes in DEV but not in PROD, this way there is still possibility for us to discover the reason of the crash in the future. Will defer to @j-piasecki for the final resolution

Hi!

You can fix this by adding

if (count == 0) return event; // Avoid crash in MotionEvent.obtain when count = 0

before

MotionEvent result = MotionEvent.obtain(
            event.getDownTime(),
            event.getEventTime(),
            action,
            count,
            sPointerProps, /* props are copied and hence it is safe to use static array here */
            sPointerCoords, /* same applies to coords */
            event.getMetaState(),
            event.getButtonState(),
            event.getXPrecision(),
            event.getYPrecision(),
            event.getDeviceId(),
            event.getEdgeFlags(),
            event.getSource(),
            event.getFlags());
    event.setLocation(oldX, oldY);
    result.setLocation(oldX, oldY);
    return result;

In GestureHandler.java, private MotionEvent adaptEvent(MotionEvent event), line 284.

You can use attached patch with patch-package: Just follow setup instructions, unzip attached file and copy into Your project patches folder (create one if needed).

react-native-gesture-handler+1.10.3.patch.zip

Hi, sorry for the late reply, I must’ve missed previous notification. As for this fix, while it will mitigate the crash it may cause gesture handlers to misbehave. One of the things that adaptEvent method is supposed to do is to filter out the pointers that shouldn’t be processed by the specific gesture handler. If it returns the original event, then the handler will receive information about all pointers on the screen at the time, which may cause other issues.

YES. But we prefer misbehavior than a crash.

Hi @j-piasecki, I have errors with the logs that you implemented in https://github.com/software-mansion/react-native-gesture-handler/pull/1685

I share you 3 logs from different users/devices

react-native: 0.64.2 react-native-gesture-handler: 2.0.0

Android: 9 3705A

Caused by com.swmansion.gesturehandler.GestureHandler$AdaptEventException: handler: RootViewGestureHandler
state: 2
view: com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView{9ce4162 V.E...... ........ 0,0-1080,1998 #1}
orchestrator: com.swmansion.gesturehandler.GestureHandlerOrchestrator@1282049
isEnabled: true
isActive: false
isAwaiting: false
trackedPointersCount: 0
trackedPointers: 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
while handling event: MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=1, x[0]=51.951897, y[0]=696.6774, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=33697344, downTime=33682540, deviceId=5, source=0x1002 }
       at com.swmansion.gesturehandler.GestureHandler.adaptEvent(GestureHandler.kt:274)
       at com.swmansion.gesturehandler.GestureHandler.handle(GestureHandler.kt:307)
       at com.swmansion.gesturehandler.GestureHandlerOrchestrator.deliverEventToGestureHandler(GestureHandlerOrchestrator.kt:250)
       at com.swmansion.gesturehandler.GestureHandlerOrchestrator.deliverEventToGestureHandlers(GestureHandlerOrchestrator.kt:206)
       at com.swmansion.gesturehandler.GestureHandlerOrchestrator.onTouchEvent(GestureHandlerOrchestrator.kt:44)
       at com.swmansion.gesturehandler.react.RNGestureHandlerRootHelper.dispatchTouchEvent(RNGestureHandlerRootHelper.kt:95)
       at com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView.dispatchTouchEvent(RNGestureHandlerEnabledRootView.kt:25)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3030)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2719)
       at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:440)
       at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1830)
       at android.app.Activity.dispatchTouchEvent(Activity.java:3401)
       at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
       at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:398)
       at android.view.View.dispatchPointerEvent(View.java:12753)
       at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5139)
       at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4942)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4459)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4512)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4478)
       at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4618)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4486)
       at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4675)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4459)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4512)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4478)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4486)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4459)
       at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7134)
       at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7103)
       at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7064)
       at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7237)
       at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:187)
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:326)
       at android.os.Looper.loop(Looper.java:160)
       at android.app.ActivityThread.main(ActivityThread.java:6746)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Android: 10 TBD view, orchestrator and trackedPointers have changes

Caused by com.swmansion.gesturehandler.GestureHandler$AdaptEventException: handler: RootViewGestureHandler
state: 2
view: com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView{2c38100 V.E...... ........ 0,0-480,888 #1}
orchestrator: com.swmansion.gesturehandler.GestureHandlerOrchestrator@5eb6eca
isEnabled: true
isActive: false
isAwaiting: false
trackedPointersCount: 0
trackedPointers: -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1
while handling event: MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=1, x[0]=288.39917, y[0]=95.9001, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=1, eventTime=182820353, downTime=182820164, deviceId=3, source=0x1002, displayId=0 }
       at com.swmansion.gesturehandler.GestureHandler.adaptEvent(GestureHandler.kt:274)
       at com.swmansion.gesturehandler.GestureHandler.handle(GestureHandler.kt:307)
       at com.swmansion.gesturehandler.GestureHandlerOrchestrator.deliverEventToGestureHandler(GestureHandlerOrchestrator.kt:250)
       at com.swmansion.gesturehandler.GestureHandlerOrchestrator.deliverEventToGestureHandlers(GestureHandlerOrchestrator.kt:206)
       at com.swmansion.gesturehandler.GestureHandlerOrchestrator.onTouchEvent(GestureHandlerOrchestrator.kt:44)
       at com.swmansion.gesturehandler.react.RNGestureHandlerRootHelper.dispatchTouchEvent(RNGestureHandlerRootHelper.kt:95)
       at com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView.dispatchTouchEvent(RNGestureHandlerEnabledRootView.kt:25)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3116)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2777)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3116)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2777)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3116)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2777)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3116)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2777)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3116)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2777)
       at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:465)
       at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1849)
       at android.app.Activity.dispatchTouchEvent(Activity.java:3993)
       at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
       at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:423)
       at android.view.View.dispatchPointerEvent(View.java:13727)
       at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5661)
       at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5455)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4954)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5007)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4973)
       at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5113)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4981)
       at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5170)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4954)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5007)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4973)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4981)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4954)
       at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7761)
       at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7730)
       at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7681)
       at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7900)
       at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:188)
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:336)
       at android.os.Looper.loop(Looper.java:174)
       at android.app.ActivityThread.main(ActivityThread.java:7386)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)

Android: 10 Stylo 6 view, orchestrator and trackedPointers have changes

Caused by com.swmansion.gesturehandler.GestureHandler$AdaptEventException: handler: RootViewGestureHandler
state: 2
view: com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView{3cba0d1 V.E...... ........ 0,0-1080,2406 #1}
orchestrator: com.swmansion.gesturehandler.GestureHandlerOrchestrator@b5033ce
isEnabled: true
isActive: false
isAwaiting: false
trackedPointersCount: 0
trackedPointers: -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1
while handling event: MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=162.30432, y[0]=626.8261, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=1, eventTime=64145701, downTime=64145521, deviceId=2, source=0x1002, displayId=0 }
       at com.swmansion.gesturehandler.GestureHandler.adaptEvent(GestureHandler.kt:274)
       at com.swmansion.gesturehandler.GestureHandler.handle(GestureHandler.kt:307)
       at com.swmansion.gesturehandler.GestureHandlerOrchestrator.deliverEventToGestureHandler(GestureHandlerOrchestrator.kt:250)
       at com.swmansion.gesturehandler.GestureHandlerOrchestrator.deliverEventToGestureHandlers(GestureHandlerOrchestrator.kt:206)
       at com.swmansion.gesturehandler.GestureHandlerOrchestrator.onTouchEvent(GestureHandlerOrchestrator.kt:44)
       at com.swmansion.gesturehandler.react.RNGestureHandlerRootHelper.dispatchTouchEvent(RNGestureHandlerRootHelper.kt:95)
       at com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView.dispatchTouchEvent(RNGestureHandlerEnabledRootView.kt:25)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3142)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2834)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3142)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2834)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3142)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2834)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3142)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2834)
       at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3142)
       at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2834)
       at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:495)
       at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1868)
       at android.app.Activity.dispatchTouchEvent(Activity.java:4022)
       at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
       at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:453)
       at android.view.View.dispatchPointerEvent(View.java:14261)
       at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5900)
       at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5703)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5150)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5203)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5169)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5177)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5150)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5203)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5169)
       at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5325)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5177)
       at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5382)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5150)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5203)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5169)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5177)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5150)
       at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7999)
       at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7966)
       at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7927)
       at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8153)
       at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:189)
       at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(InputEventReceiver.java)
       at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:179)
       at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:8083)
       at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:8177)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1049)
       at android.view.Choreographer.doCallbacks(Choreographer.java:872)
       at android.view.Choreographer.doFrame(Choreographer.java:800)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1034)
       at android.os.Handler.handleCallback(Handler.java:883)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at android.os.Looper.loop(Looper.java:214)
       at android.app.ActivityThread.main(ActivityThread.java:7615)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)

I have the same issue for a while now, currently my app is using version 1.8.0, and according to the logs the majority of the crashes are happening on a screen with a mapview (react-native-maps) and on LG stylo devices, the app does not have any custom gesture handlers, we use it because of react-navigation.

I tried debugging this one for a bit and I didn’t found much. What we know for sure: this bug is caused by array mTrackedPointerIDs being reset – we don’t track pointers for the gesture handler when the event generated by it arrives.

  1. What gesture handlers do you use in your apps?
  2. Do you have complex interactions like two (or more) gesture handlers running simultaneously and crossing themselves? I’m talking about a situation where gesture pointer may be so close to another that Android merges them.
  3. Do you use gesture handlers on the different root views? (Do you use Wix Navigation?) Interactions like showing two screens at once, modal and screen, etc, when the gesture handlers may be used.