Hello, I have many errors on my production app and I need a solution ASAP please. This error is the most encountered by my app, it happend 35 times. Do you have an idea to fix it please ?
Fatal Exception: java.lang.IllegalArgumentException
pointerIndex out of range
android.view.MotionEvent.nativeGetAxisValue (MotionEvent.java)
android.view.MotionEvent.getX (MotionEvent.java:2221)
com.mapbox.android.gestures.Utils.getRawX (Utils.java:43)
com.mapbox.android.gestures.MultiFingerGesture.isSloppyGesture (MultiFingerGesture.java:151)
com.mapbox.android.gestures.MultiFingerGesture.analyzeEvent (MultiFingerGesture.java:88)
com.mapbox.android.gestures.ProgressiveGesture.analyzeEvent (ProgressiveGesture.java:46)
com.mapbox.android.gestures.MoveGestureDetector.analyzeEvent (MoveGestureDetector.java:135)
com.mapbox.android.gestures.BaseGesture.analyze (BaseGesture.java:56)
com.mapbox.android.gestures.BaseGesture.onTouchEvent (BaseGesture.java:34)
com.mapbox.android.gestures.AndroidGesturesManager.onTouchEvent (AndroidGesturesManager.java:186)
com.mapbox.mapboxsdk.maps.MapGestureDetector.onTouchEvent (MapGestureDetector.java:218)
com.mapbox.mapboxsdk.maps.MapView.onTouchEvent (MapView.java:489)
android.view.View.dispatchTouchEvent (View.java:12593)
android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3028)
android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2705)
android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3056)
android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2719)
android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3034)
android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2719)
android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3034)
android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2719)
android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3034)
android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2719)
android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3034)
android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2719)
com.android.internal.policy.DecorView.superDispatchTouchEvent (DecorView.java:441)
com.android.internal.policy.PhoneWindow.superDispatchTouchEvent (PhoneWindow.java:1850)
android.app.Activity.dispatchTouchEvent (Activity.java:3413)
com.android.internal.policy.DecorView.dispatchTouchEvent (DecorView.java:399)
android.view.View.dispatchPointerEvent (View.java:12832)
android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent (ViewRootImpl.java:5674)
android.view.ViewRootImpl$ViewPostImeInputStage.onProcess (ViewRootImpl.java:5200)
android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:4680)
android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:4733)
android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:4699)
android.view.ViewRootImpl$AsyncInputStage.forward (ViewRootImpl.java:4839)
android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:4707)
android.view.ViewRootImpl$AsyncInputStage.apply (ViewRootImpl.java:4896)
android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:4680)
android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:4733)
android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:4699)
android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:4707)
android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:4680)
android.view.ViewRootImpl.deliverInputEvent (ViewRootImpl.java:7704)
android.view.ViewRootImpl.doProcessInputEvents (ViewRootImpl.java:7673)
android.view.ViewRootImpl.enqueueInputEvent (ViewRootImpl.java:7606)
android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent (ViewRootImpl.java:7807)
android.view.InputEventReceiver.dispatchInputEvent (InputEventReceiver.java:187)
android.view.InputEventReceiver.nativeConsumeBatchedInputEvents (InputEventReceiver.java)
android.view.InputEventReceiver.consumeBatchedInputEvents (InputEventReceiver.java:178)
android.view.ViewRootImpl.doConsumeBatchedInput (ViewRootImpl.java:7778)
android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run (ViewRootImpl.java:7830)
android.view.Choreographer$CallbackRecord.run (Choreographer.java:1172)
android.view.Choreographer.doCallbacks (Choreographer.java:984)
android.view.Choreographer.doFrame (Choreographer.java:803)
android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:1158)
android.os.Handler.handleCallback (Handler.java:873)
android.os.Handler.dispatchMessage (Handler.java:99)
android.os.Looper.loop (Looper.java:193)
android.app.ActivityThread.main (ActivityThread.java:6863)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:537)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:858)
Android versions: 6 7 8 9
Device models: Several brands and models
Mapbox SDK versions:
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:7.3.1'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:4.6.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v7:0.6.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.35.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.35.0'
What's the actual error message @ben-j69? I can't see any in the stack you've pasted.
Are you able to reproduce the issue?
@LukasPaczos I edited my post to include the forgotten
Fatal Exception: java.lang.IllegalArgumentException
pointerIndex out of range
I did not reproduce this error since I don't know how to produce it, I just know it happend 39 times and I need a fix for it
We've not heard any similar reports before @ben-j69 so it's hard to judge what might be going wrong without a reproducible case. Is there a chance that some motion events are consumed mid-gesture by draggable layouts, poping overlays or anything similar? We have guards against those instances, but maybe we are missing a case.
Could you try reproducing by taking above into consideration? Thank you!
I can reproduce the bug now, I have a scrollview in front of the map and playing with event to be able to move the map behind. Still searching for a fix on my side.
Thanks for the update @ben-j69, could you paste the sequence of motion events that are received and consumed by the scroll view/passed to the map that is resulting in this crash?
Even though all motion events should be passed to the map, especially mid-gesture, it'd be great to add a guard against this particular occurrence, so that we can internally ignore and reset instead of crashing.
Still searching for a fix on my side. The code that fail when I make multi touch gesture on my map / scrollview :
scrollview_ride_detail.setOnTouchListener(View.OnTouchListener { _, event ->
if (MiscUtils.isTouchInView(view_spacer, event)) {
try {
mMapView.onTouchEvent(event)
} catch (e: Exception) {
//That can happen
}
return@OnTouchListener true
}
false
})
public static boolean isTouchInView(View view, MotionEvent event) {
if (view == null || event == null) {
return false;
}
Rect hitBox = new Rect();
view.getGlobalVisibleRect(hitBox);
return hitBox.contains((int) event.getRawX(), (int) event.getRawY());
}
(Sorry I have no idea why the code does not format well here...)
You need to use ``` code ``` :slightly_smiling_face:
Thanks for the code - in this case, could you capture all event types that pass the if-check and go into mMapView.onTouchEvent(event) before the crash? Having this sequence I might be able to reproduce on my end with a unit test.
I have tried with a toString() to the event passed to mMapView.onTouchEvent(). I have difficulties to localize the issue. Here is the crash log
D/BookingDetailRideActivi: MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=1, x[0]=556.6797, y[0]=602.125, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=74568188, downTime=74568188, deviceId=6, source=0x1002 }
05-15 15:46:57.000 532-532/com.XXX.XXXapp.playground W/MultiFingerGesture: Some MotionEvents were not passed to the library.
05-15 15:46:57.000 532-532/com.XXX.XXXapp.playground W/MultiFingerGesture: Some MotionEvents were not passed to the library.
05-15 15:46:57.000 532-532/com.XXX.XXXapp.playground W/MultiFingerGesture: Some MotionEvents were not passed to the library.
05-15 15:46:57.000 532-532/com.XXX.XXXapp.playground W/MultiFingerGesture: Some MotionEvents were not passed to the library.
05-15 15:46:57.000 532-532/com.XXX.XXXapp.playground W/MultiFingerGesture: Some MotionEvents were not passed to the library.
05-15 15:46:57.000 532-532/com.XXX.XXXapp.playground W/MultiFingerGesture: Some MotionEvents were not passed to the library.
05-15 15:46:57.010 532-532/com.XXX.XXXapp.playground E/MotionEvent-JNI: An exception occurred: pointerCount 1, pointerIndex -1.
05-15 15:46:57.010 532-532/com.XXX.XXXapp.playground E/InputEventReceiver: Exception dispatching input event.
05-15 15:46:57.010 532-532/com.XXX.XXXapp.playground E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
05-15 15:46:57.010 532-532/com.XXX.XXXapp.playground E/MessageQueue-JNI: java.lang.IllegalArgumentException: pointerIndex out of range
at android.view.MotionEvent.nativeGetAxisValue(Native Method)
at android.view.MotionEvent.getX(MotionEvent.java:2286)
at com.mapbox.android.gestures.Utils.getRawX(Utils.java:43)
at com.mapbox.android.gestures.MultiFingerGesture.isSloppyGesture(MultiFingerGesture.java:151)
at com.mapbox.android.gestures.MultiFingerGesture.canExecute(MultiFingerGesture.java:167)
at com.mapbox.android.gestures.StandardScaleGestureDetector.innerOnScaleBegin(StandardScaleGestureDetector.java:124)
at com.mapbox.android.gestures.StandardScaleGestureDetector$1.onScaleBegin(StandardScaleGestureDetector.java:54)
at android.view.ScaleGestureDetector.onTouchEvent(ScaleGestureDetector.java:414)
at com.mapbox.android.gestures.StandardScaleGestureDetector.analyzeEvent(StandardScaleGestureDetector.java:148)
at com.mapbox.android.gestures.BaseGesture.analyze(BaseGesture.java:56)
at com.mapbox.android.gestures.BaseGesture.onTouchEvent(BaseGesture.java:34)
at com.mapbox.android.gestures.AndroidGesturesManager.onTouchEvent(AndroidGesturesManager.java:186)
at com.mapbox.mapboxsdk.maps.MapGestureDetector.onTouchEvent(MapGestureDetector.java:218)
at com.mapbox.mapboxsdk.maps.MapView.onTouchEvent(MapView.java:489)
at android.view.View.dispatchTouchEvent(View.java:9993)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2828)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2499)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2871)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2831)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1863)
at android.app.Activity.dispatchTouchEvent(Activity.java:3046)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2792)
at android.view.View.dispatchPointerEvent(View.java:10228)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5350)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5186)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4626)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4679)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4645)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4787)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4653)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4844)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4626)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4679)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4645)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4653)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4626)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7323)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7201)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7162)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7433)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.os.MessageQueue.nativePollOnce(Native
@ben-j69 are you seeing only one ACTION_DOWN before the crash? No other events? There have to be some passed to the mapView because you can see multiple Some MotionEvents were not passed to the library logs. Is mapView inside of the scroll view that intercepts all of the events?
I have a mapView behind my scrollview in a relativelayout.
For what I can see the error is fired when I callmMapView.onTouchEvent(event) It is only when I make multi fingers movements. It looks like the crash only happen when I pinch out the map.
EDIT : I think the problem is when I have one finger in the scrollview who passes the vent to the mapview and one finger in the mapview. Do you have any idea of a quick fix please ?
@ben-j69 again if you could paste the whole list of events that lead to the crash, It'd be great. Log them out:
scrollview_ride_detail.setOnTouchListener(View.OnTouchListener { _, event ->
if (MiscUtils.isTouchInView(view_spacer, event)) {
try {
Log.d("CAPTURED_EVENT", event)
mMapView.onTouchEvent(event)
} catch (e: Exception) {
//That can happen
}
return@OnTouchListener true
}
false
})
and paste here so that I can try to reproduce locally with a unit test.
A remedy to your crash might be ensuring, that each of the ACTION_DOWN, ACTION_POINTER_DOWN, ACTION_POINTER_UP and ACTION_UP events are passed to the map.
Looks like the first event make it crash :
D/CAPTURED_EVENT: MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=1, x[0]=715.2344, y[0]=584.375, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=23436900, downTime=23436900, deviceId=6, source=0x1002 }
W/MultiFingerGesture: Some MotionEvents were not passed to the library.
Some MotionEvents were not passed to the library.
Some MotionEvents were not passed to the library.
Some MotionEvents were not passed to the library.
Some MotionEvents were not passed to the library.
Some MotionEvents were not passed to the library.
E/MotionEvent-JNI: An exception occurred: pointerCount 1, pointerIndex -1.
E/InputEventReceiver: Exception dispatching input event.
E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
java.lang.IllegalArgumentException: pointerIndex out of range
at android.view.MotionEvent.nativeGetAxisValue(Native Method)
at android.view.MotionEvent.getX(MotionEvent.java:2286)
at com.mapbox.android.gestures.Utils.getRawX(Utils.java:43)
at com.mapbox.android.gestures.MultiFingerGesture.isSloppyGesture(MultiFingerGesture.java:151)
at com.mapbox.android.gestures.MultiFingerGesture.analyzeEvent(MultiFingerGesture.java:88)
at com.mapbox.android.gestures.ProgressiveGesture.analyzeEvent(ProgressiveGesture.java:46)
at com.mapbox.android.gestures.MoveGestureDetector.analyzeEvent(MoveGestureDetector.java:135)
at com.mapbox.android.gestures.BaseGesture.analyze(BaseGesture.java:56)
at com.mapbox.android.gestures.BaseGesture.onTouchEvent(BaseGesture.java:34)
at com.mapbox.android.gestures.AndroidGesturesManager.onTouchEvent(AndroidGesturesManager.java:186)
at com.mapbox.mapboxsdk.maps.MapGestureDetector.onTouchEvent(MapGestureDetector.java:218)
at com.mapbox.mapboxsdk.maps.MapView.onTouchEvent(MapView.java:489)
at android.view.View.dispatchTouchEvent(View.java:9993)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2828)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2499)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2871)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2831)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1863)
at android.app.Activity.dispatchTouchEvent(Activity.java:3046)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2792)
at android.view.View.dispatchPointerEvent(View.java:10228)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5350)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5186)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4626)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4679)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4645)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4787)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4653)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4844)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4626)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4679)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4645)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4653)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4626)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7323)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7201)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7162)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7433)
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:143)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.i
D/AndroidRuntime: Shutting down VM
I/Bugsnag: Saved unsent payload to disk (/data/user/0/com.xxx.xxxapp.debug/cache/bugsnag-errors/1558366895957_3ea6fdce-11f1-429c-9541-38fd1666cdee.json)
I/Bugsnag: Sending 1 saved error(s) to Bugsnag
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
(HTTPLog)-Static: isSBSettingEnabled false
D/FA: Logging event (FE): _ae, Bundle[{firebase_event_origin(_o)=clx, _r=1, firebase_screen_class(_sc)=BookingDetailRideActivity, firebase_screen_id(_si)=-7457571056832453815, firebase_screen(_sn)=BOOKING - Ride detail, timestamp=1558366895980, fatal=1}]
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.xxx.xxxapp.debug, PID: 12673
java.lang.IllegalArgumentException: pointerIndex out of range
at android.view.MotionEvent.nativeGetAxisValue(Native Method)
at android.view.MotionEvent.getX(MotionEvent.java:2286)
at com.mapbox.android.gestures.Utils.getRawX(Utils.java:43)
at com.mapbox.android.gestures.MultiFingerGesture.isSloppyGesture(MultiFingerGesture.java:151)
at com.mapbox.android.gestures.MultiFingerGesture.analyzeEvent(MultiFingerGesture.java:88)
at com.mapbox.android.gestures.ProgressiveGesture.analyzeEvent(ProgressiveGesture.java:46)
at com.mapbox.android.gestures.MoveGestureDetector.analyzeEvent(MoveGestureDetector.java:135)
at com.mapbox.android.gestures.BaseGesture.analyze(BaseGesture.java:56)
at com.mapbox.android.gestures.BaseGesture.onTouchEvent(BaseGesture.java:34)
at com.mapbox.android.gestures.AndroidGesturesManager.onTouchEvent(AndroidGesturesManager.java:186)
at com.mapbox.mapboxsdk.maps.MapGestureDetector.onTouchEvent(MapGestureDetector.java:218)
at com.mapbox.mapboxsdk.maps.MapView.onTouchEvent(MapView.java:489)
at android.view.View.dispatchTouchEvent(View.java:9993)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2828)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2499)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2871)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2839)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2514)
at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2831)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1863)
at android.app.Activity.dispatchTouchEvent(Activity.java:3046)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2792)
at android.view.View.dispatchPointerEvent(View.java:10228)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5350)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5186)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4626)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4679)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4645)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4787)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4653)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4844)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4626)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4679)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4645)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4653)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4626)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7323)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7201)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7162)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7433)
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:143)
at android.app.ActivityThread.main(ActivityThread.java:7224)
I was able to reproduce the issue and I've proposed a guard - https://github.com/mapbox/mapbox-gestures-android/pull/71. This guard will prevent the crashes, but will not support the use case.
The issue here is, that the ACTION_DOWN event performed on the scroll view is intercepted and force pushed to the MapView (doesn't reach it organically). Then, when another pointer lands on the actual map, the view hierarchy is not aware of the first one and delivers ACTION_DOWN again with a different pointer ID instead of the ACTION_POINTER_DOWN. This way the gesture recognizer thinks that we are dealing with only one pointer (because it only received ACTION_DOWN), when in fact there are 2, one being pushed from the scroll view.
To support the use case, I think you'll need to extend the scroll view and tinker with the onInterceptTouchEvent or other motion events management methods to actually let the event through your transparent view to the map instead of forcing it from the outside.
Closing as not actionable from the Maps SDK perspective. The guard against the crash is going to be introduced with the next gestures library bump.
@LukasPaczos thanks for the investigation and the guard proposition