mapbox / mapbox-navigation-android

Mapbox Navigation SDK for Android
https://docs.mapbox.com/android/navigation/overview/
Other
622 stars 319 forks source link

RouteLineDistancesIndex.getPoint() NullPointerException #3690

Open kmadsen opened 4 years ago

kmadsen commented 4 years ago

Steps to trigger behavior

Unknown at this time. I just ran into it while testing on the main branch.

Issue

2020-10-26 12:10:21.310 9969-9969/com.mapbox.navigation.examples E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.mapbox.navigation.examples, PID: 9969
    java.lang.NullPointerException: Attempt to invoke virtual method 'com.mapbox.geojson.Point com.mapbox.navigation.ui.route.RouteLineDistancesIndex.getPoint()' on a null object reference
        at com.mapbox.navigation.ui.route.MapRouteLine.updateTraveledRouteLine(MapRouteLine.kt:1052)
        at com.mapbox.navigation.ui.route.NavigationMapRoute$1.onIndicatorPositionChanged(NavigationMapRoute.java:343)
        at com.mapbox.mapboxsdk.location.LocationComponent$10.onIndicatorPositionChanged(LocationComponent.java:1880)
        at com.mapbox.mapboxsdk.location.LocationLayerController$1.onNewAnimationValue(LocationLayerController.java:269)
        at com.mapbox.mapboxsdk.location.LocationLayerController$1.onNewAnimationValue(LocationLayerController.java:265)
        at com.mapbox.mapboxsdk.location.MapboxAnimator.postUpdates(MapboxAnimator.java:106)
        at com.mapbox.mapboxsdk.location.MapboxAnimator.onAnimationUpdate(MapboxAnimator.java:93)
        at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1566)
        at android.animation.ValueAnimator.animateBasedOnTime(ValueAnimator.java:1357)
        at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1489)
        at android.animation.ValueAnimator.pulseAnimationFrame(ValueAnimator.java:1508)
        at android.animation.AnimatorSet.pulseFrame(AnimatorSet.java:1170)
        at android.animation.AnimatorSet.doAnimationFrame(AnimatorSet.java:1061)
        at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146)
        at android.animation.AnimationHandler.access$100(AnimationHandler.java:37)
        at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:54)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:970)
        at android.view.Choreographer.doCallbacks(Choreographer.java:796)
        at android.view.Choreographer.doFrame(Choreographer.java:727)
Guardiola31337 commented 4 years ago

cc @abhishek1508 @cafesilencio

LukasPaczos commented 4 years ago

I also run into this once while testing https://github.com/mapbox/mapbox-navigation-android/pull/3727. I wasn't able to reproduce, so I only added an if-check in https://github.com/mapbox/mapbox-navigation-android/pull/3727 for now. We should try to get to the bottom of this though.

LukasPaczos commented 3 years ago

Additional information from one of the customers:

In the test, the user puck was moving with simulated gps data. And then we tried to start an active navigation with a route while the user is still moving. Upon start of the navigation, we tried to load a different map style as well.

It look like the location update caused the route line update to perform while the route is not fully ready yet. It's timing sensitive, so far we only observe this once.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.