Invalid request: for guidanceVersion 2 the travelMode

It seems to be related to the vehicle type, but I’m unsure if/how i can see the full error message I get back from the server: it is shown in a toast message that is cut off, and it does not appear in logcat from what I can tell.

image

The configured Vehicle in my case is a CargoCapable Van, though no hazmat/tunnel restrictions are applied in this case. Since the Van was only recently made CargoCapable, this may be related?

The RoutePlanningOptions are as follows:

RoutePlanningOptions(
  itinerary=Itinerary(
    origin=ItineraryPoint(
      place=Place(
        coordinate=GeoPoint(latitude=X, longitude=X), 
        name='Origin location', 
        address=null, 
        entryPoints=[]
      ), 
      heading=null
    ), 
    destination=ItineraryPoint(
      place=Place(
        coordinate=GeoPoint(latitude=X, longitude=X), 
        name='Destination location', 
        address=null, 
        entryPoints=[]
      ), 
      heading=null
    ), 
    waypoints=[]
  ), 
  costModel=CostModel(
    routeType=Fast, 
    considerTraffic=ConsiderTraffic(value=0), 
    avoidOptions=null
  ), 
  departAt=null, 
  arriveAt=null, 
  alternativeRoutesOptions=null, 
  guidanceOptions=null, 
  routeLegOptions=[], 
  vehicle=Van(
    maxSpeed=null, 
    isCommercial=false, 
    electricEngine=null, 
    combustionEngine=null, 
    dimensions=null, 
    modelId=null, 
    hazmatClasses=[], 
    adrTunnelRestrictionCode=null
  ), 
  chargingOptions=null, 
  queryOptions=null, 
  waypointOptimization=null, 
  mode=RouteInformationMode(type=0), 
  arrivalSidePreference=ArrivalSidePreference(value=0)
)

My SDK version is 0.47.0

Is Van resolved properly? I can’t see imports here, and usually in docs we use Vehicle.Van()

Hi! I’m integrating the SDK with Flutter, so I’m sending JSON serialized RoutePlanningOptions (including the Vehicle) from Flutter to Android. I use GSon to deserialize it like so:

// the value of json is {"maxSpeed":null,"type":4,"isCommercial":false,"dimensions":null,"modelId":null,"adrTunnelRestrictionCode":null,"hazmatClasses":[]}
gson.fromJson(json, Vehicle.Van::class.java)

But just to try, I have just tried to replace it with a default Vehicle.Van() for you.

However, I still get the same toast message I posted above.

When I use a Vehicle.Car() instead, it works as expected

The full error is " Invalid request: for guidanceVersion 2 the travelMode must be car, motorcycle or truck."
So the guidance is supported only for those vehicles.

Ah, that confirms my suspicion that the Van vehicle is the “problem”.

When I specify guidance version 1, it says that this is deprecated, and I am directed to instead use v2.

What should I make of this? Should I just keep using v1 until a future update to the guidance API adds support for the missing vehicle types? Even though v1 is already deprecated? I guess it shouldn’t have been deprecated yet, if the guidance API V2 is still not complete…

Or would you propose another course of action?