mapbox-maps-android icon indicating copy to clipboard operation
mapbox-maps-android copied to clipboard

IllegalArgumentException kotlin.math.MathKt__MathJVMKt in roundToInt

Open pizzacoffeecode opened this issue 3 years ago • 4 comments

Environment

  • Android OS version: 11
  • Devices affected: OnePlusPro8
  • Maps SDK Version: 10.11.2

Observed behavior and steps to reproduce

Unknown

Expected behavior

App not to crash

Notes / preliminary analysis

There are no references to custom code in error logs, all looks related to mapbox.

Additional links and references

`kotlin.math.MathKt__MathJVMKt in roundToInt at line 619

com.mapbox.maps.plugin.viewport.transition.TransitionUtilsKt in roundTo at line 46

com.mapbox.maps.plugin.viewport.transition.TransitionUtilsKt in normalizeBearing at line 37

com.mapbox.maps.plugin.viewport.transition.MapboxViewportTransitionFactory in transitionFromLowZoomToHighZoom at line 72

com.mapbox.maps.plugin.viewport.transition.DefaultViewportTransitionImpl in createAnimatorSet at line 137

com.mapbox.maps.plugin.viewport.transition.DefaultViewportTransitionImpl in run$lambda-3 at line 68

com.mapbox.maps.plugin.viewport.transition.DefaultViewportTransitionImpl in $r8$lambda$Dm5KN4W8ZFs-jPnk6TvM6D2XbLA

com.mapbox.maps.plugin.viewport.transition.DefaultViewportTransitionImpl$$ExternalSyntheticLambda1 in onNewData at line 15

com.mapbox.maps.plugin.viewport.state.FollowPuckViewportStateImpl in notifyViewportStateDataObserver at line 81

com.mapbox.maps.plugin.viewport.state.FollowPuckViewportStateImpl in notifyLatestViewportData at line 69

com.mapbox.maps.plugin.viewport.state.FollowPuckViewportStateImpl in indicatorPositionChangedListener$lambda-0 at line 51

com.mapbox.maps.plugin.viewport.state.FollowPuckViewportStateImpl in $r8$lambda$1FFQMeE76PqUckIDkzhBjeBUQTc

com.mapbox.maps.plugin.viewport.state.FollowPuckViewportStateImpl$$ExternalSyntheticLambda2 in onIndicatorPositionChanged at line 2

com.mapbox.maps.plugin.locationcomponent.LocationComponentPluginImpl in indicatorPositionChangedListener$lambda-1 at line 81

com.mapbox.maps.plugin.locationcomponent.LocationComponentPluginImpl in $r8$lambda$tH84PKxP_CGg6Eh9PozddvGFbNI

com.mapbox.maps.plugin.locationcomponent.LocationComponentPluginImpl$$ExternalSyntheticLambda3 in onIndicatorPositionChanged at line 2

com.mapbox.maps.plugin.locationcomponent.animators.PuckPositionAnimator in updateLayer at line 10

com.mapbox.maps.plugin.locationcomponent.animators.PuckPositionAnimator in updateLayer at line 6

com.mapbox.maps.plugin.locationcomponent.animators.PuckAnimator$1$1 in invoke at line 36

com.mapbox.maps.plugin.locationcomponent.animators.PuckAnimator$1$1 in invoke at line 33

com.mapbox.maps.threading.AnimationThreadController in postOnMainThread at line 67

com.mapbox.maps.plugin.locationcomponent.animators.PuckAnimator in init$lambda-0 at line 33

com.mapbox.maps.plugin.locationcomponent.animators.PuckAnimator in $r8$lambda$DKuRutUBCyf6yKd5UEMf-U8meWw

com.mapbox.maps.plugin.locationcomponent.animators.PuckAnimator$$ExternalSyntheticLambda0 in onAnimationUpdate at line 2

android.animation.ValueAnimator in animateValue at line 1566

android.animation.ValueAnimator in animateBasedOnTime at line 1357

android.animation.ValueAnimator in doAnimationFrame at line 1489

android.animation.AnimationHandler in doAnimationFrame at line 146

android.animation.AnimationHandler in access$100 at line 37

android.animation.AnimationHandler$1 in doFrame at line 54

android.view.Choreographer$CallbackRecord in run at line 970

android.view.Choreographer in doCallbacks at line 796

android.view.Choreographer in doFrame at line 727

android.view.Choreographer$FrameDisplayEventReceiver in run at line 957

android.os.Handler in handleCallback at line 938

android.os.Handler in dispatchMessage at line 99

android.os.Looper in loop at line 223

android.app.ActivityThread in main at line 7680

java.lang.reflect.Method in invoke

com.android.internal.os.RuntimeInit$MethodAndArgsCaller in run at line 592

com.android.internal.os.ZygoteInit in main at line 947`

pizzacoffeecode avatar Apr 13 '23 13:04 pizzacoffeecode

@pizzacoffeecode hey, any other information how this crash was triggered? From the codebase it looks all the vars are guarded against null, MapboxViewportTransitionFactory, Utils

yunikkk avatar Apr 14 '23 08:04 yunikkk

Hi, I go it in my firebase logs as well. It's not a null problem but a NaN problem. java.lang.IllegalArgumentException: Cannot round NaN value. i guess from MapboxViewportTransitionFactory currentMapCameraState.bearing is NaN at that time.

SamYStudiO avatar Dec 01 '23 14:12 SamYStudiO