Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Drop-In UI : Crash in MapboxRouteLineUtils.kt line 574 #6784

Closed
Sridhar261990 opened this issue Jan 5, 2023 · 5 comments
Closed
Assignees

Comments

@Sridhar261990
Copy link

Hi Team,

I am using the mapbox DropInUi in my app. I am getting the below crash.

Fatal Exception: java.lang.ArrayIndexOutOfBoundsException
length=1; index=1
com.mapbox.navigation.ui.maps.internal.route.line.MapboxRouteLineUtils$extractRouteRestrictionData$1.invoke (MapboxRouteLineUtils.kt:574)
com.mapbox.navigation.ui.maps.internal.route.line.MapboxRouteLineUtils$extractRouteRestrictionData$1.invoke (MapboxRouteLineUtils.kt:591)
com.mapbox.navigation.ui.maps.util.CacheResultUtils$CacheResultKeyRoute.invoke (CacheResultUtils.kt:37)
com.mapbox.navigation.ui.maps.util.CacheResultUtils$CacheResultKeyRoute.invoke (CacheResultUtils.kt:34)
com.mapbox.navigation.ui.maps.util.CacheResultUtils$CacheResultHandler.invoke (CacheResultUtils.kt:122)
com.mapbox.navigation.ui.maps.util.CacheResultUtils$cacheRouteResult$1.invoke (CacheResultUtils.kt:111)
com.mapbox.navigation.ui.maps.util.CacheResultUtils$cacheRouteResult$1.invoke (CacheResultUtils.kt:105)
com.mapbox.navigation.ui.maps.route.line.api.MapboxRouteLineApi$buildDrawRoutesState$primaryRouteRestrictedSectionsExpressionDef$1.invokeSuspend (MapboxRouteLineApi.kt:1267)
kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33)
kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:106)
kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely (CoroutineScheduler.kt:571)
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask (CoroutineScheduler.kt:750)
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker (CoroutineScheduler.kt:678)
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run (CoroutineScheduler.kt:665)

Mapbox Navigation SDK version: implementation 'com.mapbox.navigation:ui-app:2.10.0-rc.1'
implementation 'com.mapbox.navigation:ui-dropin:2.10.0-rc.1'

It is happening very rarely and I don't know in which case it is happening. Please check it and let me know how to solve this issue.

@Guardiola31337
Copy link
Contributor

@abhishek1508 could you take a look at this when you have a chance? 🙏

@cafesilencio cafesilencio self-assigned this Jan 6, 2023
@cafesilencio
Copy link
Contributor

cafesilencio commented Jan 6, 2023

@Sridhar261990 Is there any chance you can provide a route or origin/destination that causes this error?

Also can you confirm you are setting the displayRestrictedRoadSections in MapboxRouteLineOptions to true and providing these options to the DropIn UI as custom options?

@Sridhar261990
Copy link
Author

Hi @cafesilencio, I don't have exact route coordinates. I will try to find out that and let you know. I am setting displayRestrictedRoadSections as true in MapboxRouteLineOptions and using that as a custom options.

@EricGeiler
Copy link

EricGeiler commented Jan 9, 2023

@cafesilencio See below for additional info as requested. I hope this helps.. it matchs up with what I see in firebase when comparing timestamps. Driver seems to have made 2 directions requests with a couple of mins... however the destination is the same, this may assist you in determining the arrival path/route if required.
image

2023-01-06 12:38:01: DirectionsOrderLocation - https://api.mapbox.com/directions/v5/mapbox/driving-traffic/-79.3801904,43.6698924;-79.3768158,43.6691628?access_token=***********&geometries=polyline6&alternatives=true&overview=full&steps=true&continue_straight=true&annotations=congestion_numeric%2Cspeed%2Cdistance%2Cduration&language=en&roundabout_exits=true&voice_instructions=true&banner_instructions=true&voice_units=metric&exclude=toll&enable_refresh=true&snapping_include_closures=true%3Btrue&snapping_include_static_closures=true%3Btrue&max_height=1.6&max_width=1.9&max_weight=2.5
2023-01-06 12:38:01: DirectionsOrderLocation -onRoutesReady -NavigationRoute#id E9ckBf7eaLrUf6IzE34aT9ybcb8MXiKi-Sm_XWIGxIcJFsX3jtAqcg==#0
2023-01-06 12:38:01: DirectionsOrderLocation -onRoutesReady -DirectionsResponse#uuid E9ckBf7eaLrUf6IzE34aT9ybcb8MXiKi-Sm_XWIGxIcJFsX3jtAqcg==

2023-01-06 12:43:19: DirectionsOrderLocation - https://api.mapbox.com/directions/v5/mapbox/driving-traffic/-79.377087,43.669216;-79.3768158,43.6691628?access_token=**************&geometries=polyline6&alternatives=true&overview=full&steps=true&continue_straight=true&annotations=congestion_numeric%2Cspeed%2Cdistance%2Cduration&language=en&roundabout_exits=true&voice_instructions=true&banner_instructions=true&voice_units=metric&exclude=toll&enable_refresh=true&snapping_include_closures=true%3Btrue&snapping_include_static_closures=true%3Btrue&max_height=1.6&max_width=1.9&max_weight=2.5
2023-01-06 12:43:19: DirectionsOrderLocation -onRoutesReady -NavigationRoute#id 5SJQsxUAoD-MqXEgG2lZoF4NoXYG1AcU1dTjH7oSOIczELRr49UquQ==#0
2023-01-06 12:43:19: DirectionsOrderLocation -onRoutesReady -DirectionsResponse#uuid 5SJQsxUAoD-MqXEgG2lZoF4NoXYG1AcU1dTjH7oSOIczELRr49UquQ==

@cafesilencio
Copy link
Contributor

This issue was addressed here: #6742

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants