mapbox-flutter icon indicating copy to clipboard operation
mapbox-flutter copied to clipboard

directions_handler NoSuchMethodError

Open JoelJoos opened this issue 2 years ago • 2 comments

When debugging on a physical Android Device, It throws an error at directions_handler.dart Line 12:

NoSuchMethodError (NoSuchMethodError: The method '[]' was called on null.
Receiver: null
Tried calling: []("routes"))

This occurs just after starting to debug while the MapBox logo is still shown on the device. I guess the response variable is still null since there wasn't a call for getCyclingRouteUsingMapbox, but it is still needed at the start by the Map geometry variable.

JoelJoos avatar Jun 20 '22 12:06 JoelJoos

you have to write mapbox at the end of the baseUrl 'https://api.mapbox.com/directions/v5/mapbox'

omar-hadek avatar Aug 03 '22 13:08 omar-hadek

Connection timeout with API server E/flutter (30718): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: NoSuchMethodError: The method '[]' was called on null. E/flutter (30718): Receiver: null E/flutter (30718): Tried calling: E/flutter (30718): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:38:5) E/flutter (30718): #1 getDirectionsAPIResponse (package:healthsearch/helpers/directions_handler.dart:12:26)

sumanbalayar08 avatar Mar 01 '23 08:03 sumanbalayar08