Trying to add more than 1 waypoint to the route but it just doesn't even build the route :
val builder = NavigationRoute.builder(this@MainActivity) //1
.accessToken(Mapbox.getAccessToken()!!) //2
.origin(originPoint) //3
.destination(endPoint) //4
for (wayPoint in wayPoints) {
builder.addWaypoint(wayPoint)
}
builder.build()
in my app.gradle I have added al the dependencies needed :
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:8.4.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.42.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.42.1'
Note
When I add a single waypoint in the route this way :
val builder = NavigationRoute.builder(this@MainActivity) //1
.accessToken(Mapbox.getAccessToken()!!) //2
.origin(originPoint) //3
.destination(endPoint) //4
.addWaypoint(wayPoint)
.build()
it works normally .