akexorcist / GoogleDirectionLibrary

[Android] Library for Google Direction API for Google Maps Android API v2
Apache License 2.0
571 stars 174 forks source link

GOOGLE DIRECTION :: ISSUE WHEN ADD DEPARTURE TIME TO REQUEST #74

Closed sahil239 closed 4 years ago

sahil239 commented 4 years ago

Hi,

Facing issue when pass departure time to calculate the time difference. Version: 1.2.0 and lower version as well. Please advice.

Following are my logs from android studio.

2020-06-26 10:48:15.740 22688-22688/com..*D/routing>>:{"headers":{"namesAndValues":[]},"method":"GET","tags":{"class retrofit2.Invocation":{"arguments":["13.770641035699155,100.47946639358999","13.744866,100.529787",null,"driving","1593143295675",null,"metric",null,null,false,"AIzaxxxxxx****xxxxxxx*****"],"method":{"artMethod":499482674080,"override":false}}},"url":{"host":"maps.googleapis.com","password":"","pathSegments":["maps","api","directions","json"],"port":443,"queryNamesAndValues":["origin","13.770641035699155,100.47946639358999","destination","13.744866,100.529787","mode","driving","departure_time","1593143295675","units","metric","alternatives","false","key","AIzaxxxxxx****xxxxxxx*****"],"scheme":"https","url":"https://maps.googleapis.com/maps/api/directions/json?origin\u003d13.770641035699155%2C100.47946639358999\u0026destination\u003d13.744866%2C100.529787\u0026mode\u003ddriving\u0026departure_time\u003d1593143295675\u0026units\u003dmetric\u0026alternatives\u003dfalse\u0026key\u003dAIzaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","username":""}} 2020-06-26 10:48:16.511 22688-22688/com.***.D/routing>>: Attempt to invoke virtual method 'boolean com.akexorcist.googledirection.model.Direction.isOK()' on a null object reference

Thanks.

sahil239 commented 4 years ago

Found the issue:: Instead of using the timestamp in departure_now, have to use now. Works fine with now and failed with a timestamp.