mapbox / mapbox-navigation-android

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

Android Drop-In UI - MapboxRouteLineUtils.kt line 1574 crash. #6410

Closed EricGeiler closed 2 years ago

EricGeiler commented 2 years ago

Mapbox Navigation SDK

implementation 'com.mapbox.navigation:ui-app:2.8.0-rc.3' implementation 'com.mapbox.navigation:ui-dropin:2.8.0-rc.3'

Seeing this in 2.8.0-rc3 during our driver testing, its been triggered by a few drivers this a.m. Data obtained from our Firebase Acct.


Fatal Exception: java.lang.ArrayIndexOutOfBoundsException: length=8; index=8
       at com.mapbox.navigation.ui.maps.internal.route.line.MapboxRouteLineUtils.getAlternativeRouteDeviationOffsets$libnavui_maps_release(MapboxRouteLineUtils.kt:1574)
       at com.mapbox.navigation.ui.maps.route.line.api.MapboxRouteLineApi.setNewRouteData(MapboxRouteLineApi.kt:1202)
       at com.mapbox.navigation.ui.maps.route.line.api.MapboxRouteLineApi.access$setNewRouteData(MapboxRouteLineApi.kt:199)
       at com.mapbox.navigation.ui.maps.route.line.api.MapboxRouteLineApi$setNewRouteData$1.invokeSuspend(:15)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
       at android.os.Handler.handleCallback(Handler.java:883)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at android.os.Looper.loop(Looper.java:214)
       at android.app.ActivityThread.main(ActivityThread.java:7432)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:520)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)

cc: @sridhar261990 as he can add more technical info if required.

EricGeiler commented 2 years ago

thinking this issue maybe the same as #6404

abhishek1508 commented 2 years ago

This definitely looks similar to #6404

@LukasPaczos Can you please confirm?

LukasPaczos commented 2 years ago

This does look like the same issue but it would have to be a very short route (just 8 geometry points).

@EricGeiler @Sridhar261990 do you perhaps have the NavigationRoute#ids of the routes that were used when this exception was thrown? Or DirectionsResponse#uuid?

EricGeiler commented 2 years ago

@LukasPaczos checking on our end...

EricGeiler commented 2 years ago

I'm sorry, we don't have that information logged as of now. I've asked @sridhar261990 to include the uuid in our logfile for all directions requests.

However I see some info that makes me go umm...

image

polyline6: cbqirAd|{lvC[VcDr@{AsKbDiB~@k@zAk@jDw@~@BdOaF

looks like it was indeed a small route... im wondering if this due to a driver triggering a re-route when making a wrong turn on approach... i.e in parking lot etc.

I know @sridhar261990 had implemented #6403 prior to this being present on our build.

LukasPaczos commented 2 years ago

Thanks for checking @EricGeiler! The issue is only reproducible if there's at least one alternative present and would not be triggered by the code suggestion from https://github.com/mapbox/mapbox-navigation-android/issues/6403#issuecomment-1261184609.

The change that hardens the codebase was released in v2.8.0, we'd appreciate if you could upgrade and monitor further occurrences, there should be none.

As a side note, you can also capture and redirect/save logs produced by Mapbox by overriding the logging client - https://docs.mapbox.com/android/navigation/guides/get-started/modularization/#logger. By default, only Info and more severe logs are printed. If you'd like to print Debug logs as well, you can enabled that with:

LogConfiguration.setLoggingLevel(LoggingLevel.DEBUG)

These logs are often extremely helpful for us when debugging issues.

EricGeiler commented 2 years ago

@sridhar261990 lets discuss today getting these recommended changes in place as soon as we can to assist mapbox.

abhishek1508 commented 2 years ago

@Sridhar261990 @EricGeiler Any updates on this? Is this still crashing for you?

abhishek1508 commented 2 years ago

@Sridhar261990 @EricGeiler Any updates on this? Is this still crashing for you?

EricGeiler commented 2 years ago

After a decent amount of testing on 2.9.0beta.2 im no longer seeing this issue. closing this ticket at this time

@abhishek1508 sorry for the delay, but I wanted to ensure it was resovled.

abhishek1508 commented 2 years ago

@EricGeiler That's great. Thank you for the update.