mapbox / mapbox-maps-android

Interactive, thoroughly customizable maps in native Android powered by vector tiles and OpenGL.
https://www.mapbox.com/mobile-maps-sdk
Other
475 stars 133 forks source link

Crash during drag #1529

Closed akirmse closed 1 year ago

akirmse commented 2 years ago

Environment

I got the following crash reported via Crashlytics from a user:

Fatal Exception: java.lang.Error latitude must not be NaN

com.mapbox.maps.CameraManager.getDragCameraOptions (CameraManager.java) com.mapbox.maps.NativeMapImpl.getDragCameraOptions (NativeMapImpl.kt:55) com.mapbox.maps.MapboxMap.getDragCameraOptions (MapboxMap.kt:1643) com.mapbox.maps.plugin.gestures.GesturesPluginImpl.handleMove$plugin_gestures_release (GesturesPluginImpl.kt:1412) com.mapbox.maps.plugin.gestures.GesturesPluginImpl$MoveGestureListener.onMove (GesturesPluginImpl.kt:492) com.mapbox.android.gestures.MoveGestureDetector.analyzeMovement (MoveGestureDetector.java:158) com.mapbox.android.gestures.MultiFingerGesture.analyzeEvent (MultiFingerGesture.java:106) com.mapbox.android.gestures.ProgressiveGesture.analyzeEvent (ProgressiveGesture.java:55) com.mapbox.android.gestures.MoveGestureDetector.analyzeEvent (MoveGestureDetector.java:141) com.mapbox.maps.plugin.gestures.GesturesPluginImpl. (GesturesPluginImpl.kt:61) com.mapbox.android.gestures.BaseGesture.analyze (BaseGesture.java:61) com.mapbox.android.gestures.BaseGesture.onTouchEvent (BaseGesture.java:39) com.mapbox.android.gestures.AndroidGesturesManager.onTouchEvent (AndroidGesturesManager.java:193) com.mapbox.maps.plugin.gestures.GesturesPluginImpl.onTouchEvent (GesturesPluginImpl.kt:287) com.mapbox.maps.plugin.MapPluginRegistry.onTouch (MapPluginRegistry.kt:128) com.mapbox.maps.MapController.onTouchEvent (MapController.kt:174) com.mapbox.maps.MapView.onTouchEvent (MapView.kt:299) android.view.View.dispatchTouchEvent (View.java:15076)

(... many more internal Android stack frames)

kiryldz commented 2 years ago

Looks like this should be fixed by https://github.com/mapbox/mapbox-maps-android/pull/1492, that's available in https://github.com/mapbox/mapbox-maps-android/releases/tag/android-v10.7.0-rc.1.

akirmse commented 2 years ago

I don't think this was fixed. I just got a crash report with the same stack trace running version 10.8.1 of the library. The device is a Galaxy J5 Prime running Android 8.

akirmse commented 2 years ago

@kiryldz I just reproduced this locally on my first use of version 10.9.0 on a Samsung Galaxy S9.

pengdev commented 1 year ago

It seems is crashing at a different place, added a fix in https://github.com/mapbox/mapbox-maps-android/pull/1906, @akirmse could you try it out when it's landed?