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

instructionIndex is null message

Open wirthandras opened this issue 1 year ago • 2 comments

Hello!

We got message sometimes from navigation lib like this "instructionIndex is null"

Our business code is request a new route on custom events during navigation (not just once). And the requested new route has shared waypoints with the previous one. And We are using silent waypoints except first and last waypoints.

mapboxNavigation.requestRoutes(
            RouteOptions.builder()
                .applyDefaultNavigationOptions()
                .applyLanguageAndVoiceUnitOptions(this)
                .coordinatesList(coordinates)
                .waypointIndicesList(
                    listOf(0, lastIndex)
                )
                .build(),
            object : NavigationRouterCallback {
                override fun onCanceled(routeOptions: RouteOptions, routerOrigin: RouterOrigin) {
                    // no impl
                }

                override fun onFailure(reasons: List<RouterFailure>, routeOptions: RouteOptions) {
                    // no impl
                }

                override fun onRoutesReady(
                    routes: List<NavigationRoute>,
                    routerOrigin: RouterOrigin
                ) {
                  mapboxNavigation.setNavigationRoutes(routes)
                }
            }
        )

implemetation based of this example

Android API: 28 Mapbox Navigation SDK version: 2.19.0

Steps to trigger behavior

  1. Request a route to start navigation
  2. Little delay or travel to half of the path
  3. Request a new route and set it again.. and again until custom end.

Expected behavior

no instructionIndex is null message and no weird navigation

Actual behavior

instructionIndex is null message occured some times, and the navigation became weird, (weird == navigation seems lost, the progress observer produce false data related to remaining waypoint count) Our experience say mostly happen in intersections, but not at all

wirthandras avatar Jun 12 '24 14:06 wirthandras

I have the same problem. I tried to debug it bottom-to-up, and finally, I found out that the status coming from NavigatorObserver had a null bannerInstruction that caused this problem. This bug comes from the native processor.

Mapbox Navigation SDK version: 2.20.2

Aminsaveh avatar Sep 17 '24 13:09 Aminsaveh

@VysotskiVadim, @kiryldz, Could You please take a look at this problem?

Aminsaveh avatar Sep 17 '24 13:09 Aminsaveh