Closed florianPOLARSTEPS closed 1 year ago
@florianPOLARSTEPS could you please provide full code snippet that results in this crash?
@kiryldz Unfortunately I am not able to pinpoint the exact location of the crash since it seems to happen on the animation thread somewhere after a flyTo
animation was started. (of which I have plenty). There is no entry of mine in the stack-trace.
The cause of the issue seems logical though... to me. In the mapbox-sdk (StandardGestureListener.onFling
) fields are presumed NonNull
which coming from the Android SDK are not annotated as such. In which case a MotionEvent
can be null
, I honestly do not know... Probably some sort of edge-case, but nevertheless I think it should be handled as Nullable
.
What I forgot to mention is that it is happening rather rarely for my app, so it has not a big impact at the moment. Which again means it is some sort of edgecase/ race-condition.
Can you at least describe your use-case more precisely?
If I understood correctly you call flyTo
and sometimes it does crash? I assume you interrupt some camera flies by gestures - is it correct?
@kiryldz Like mentioned initially, I am unable to reproduce this issue... I am seeing it happening to users in my reporting (crashlytics) only. But to answer your question... Yes, the user can interrupt a flyTo
animation with a gesture.
I am not sure why this fix is taking so long. In my view it's a clear bug in the mapbox sdk. If you imply a value to be non-null in kotlin and it can be null in the java world it will crash. Simple as that.
The cause of the issue seems logical though... to me. In the mapbox-sdk (
StandardGestureListener.onFling
) fields are presumedNonNull
which coming from the Android SDK are not annotated as such. In which case aMotionEvent
can benull
, I honestly do not know... Probably some sort of edge-case, but nevertheless I think it should be handled asNullable
.
I'm also observing this crash on Mapbox 10.7.0
@alexbranti @florianPOLARSTEPS the issue is fixed in the downstream lib here and will be supposedly released in 10.9
@alexbranti @florianPOLARSTEPS 10.9.0 has the updated gestures dependency, this issues should be resolved.
Environment
Observed behavior and steps to reproduce
I am not able to reproduce this issue but it seems to be an issue with the inherited nullability of MotionEvent fields from the Android framework. (android.view.GestureDetector.GestureListener)
It may be wise to assume that all MotionEvents in the GestureDetector.OnGestureListener callbacks can be null.
Expected behavior
Does not crash when the user interacts with the map
Notes / preliminary analysis
Additional links and references