mapbox / mapbox/mapbox-navigation-android
IndexOutOfBound crash in optimization api use
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 651
- Forks
- 321
- PR merge metrics
- No merged PRs in 30d
Description
I am trying to use Optimization api - https://docs.mapbox.com/android/java/overview/optimization/
I am getting following crash in this :
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.get(ArrayList.java:437)
at com.mapbox.services.android.navigation.ui.v5.route.MapRouteLine.buildWayPointFeatureFromLeg(MapRouteLine.java:359)
at com.mapbox.services.android.navigation.ui.v5.route.MapRouteLine.buildWayPointFeatureCollectionFrom(MapRouteLine.java:351)
at com.mapbox.services.android.navigation.ui.v5.route.MapRouteLine.drawWayPoints(MapRouteLine.java:345)
at com.mapbox.services.android.navigation.ui.v5.route.MapRouteLine.access$300(MapRouteLine.java:45)
at com.mapbox.services.android.navigation.ui.v5.route.MapRouteLine$1.onRouteFeaturesProcessed(MapRouteLine.java:331)
at com.mapbox.services.android.navigation.ui.v5.route.FeatureProcessingTask$1.run(FeatureProcessingTask.java:65)
at android.os.Handler.handleCallback(Handler.java:888)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:8178)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
Android API:
Mapbox Navigation SDK version: 0.42.6
Sample code : https://drive.google.com/file/d/1VZVjlSWWV2qEJ_WUaiJCCg5dT5aLSxMp/view?usp=sharing
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with MapRouteLine.java around lines 345-359 in the stack trace, then trace the call from FeatureProcessingTask.java. Reproduce the crash using the linked optimization API sample with Navigation SDK 0.42.6. Done means the optimization route no longer throws IndexOutOfBoundsException while drawing waypoints.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100