osm_flutter icon indicating copy to clipboard operation
osm_flutter copied to clipboard

changeLocationMarker() null cannot be cast to non-null

Open smiesnyrobert opened this issue 2 years ago • 11 comments

Hey, can u please help with this problem? I want first time add marker to map and then just changelocation of this marker. I have something like this in my code

setupMarker(){
  if (oldLocation!= null) {
     await controller.changeLocationMarker(oldLocation: oldLocation, newLocation: geo,markerIcon: icon);
  } else {
     await controller.addMarker(geo, markerIcon: icon);
     oldLocation = geo;
  }
}

if method changeLocationMarker() is called i got this error (only if i add markerIcon parameter)

java.lang.NullPointerException: null cannot be cast to non-null type kotlin.ByteArray
E/AndroidRuntime(20508): 	at hamza.dali.flutter_osm_plugin.FlutterOsmView$changePositionMarker$1.invokeSuspend(FlutterOsmView.kt:591)

smiesnyrobert avatar May 08 '23 18:05 smiesnyrobert