flutter_mapbox_navigation
flutter_mapbox_navigation copied to clipboard
null cannot be cast to non-null type kotlin.Boolean
I get an error when using the embedded view mode
flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, null cannot be cast to non-null type kotlin.Boolean, null, java.lang.NullPointerException: null cannot be cast to non-null type kotlin.Boolean
E/flutter (30500): at com.eopeter.fluttermapboxnavigation.models.views.EmbeddedNavigationMapView.initialize(EmbeddedNavigationMapView.kt:36)
E/flutter (30500): at com.eopeter.fluttermapboxnavigation.factory.EmbeddedNavigationViewFactory.create(EmbeddedNavigationViewFactory.kt:33)
E/flutter (30500): at io.flutter.plugin.platform.PlatformViewsController.createPlatformView(PlatformViewsController.java:520)
E/flutter (30500): at io.flutter.plugin.platform.PlatformViewsController$1.createForPlatformViewLayer(PlatformViewsController.java:165)
E/flutter (30500): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:105)
E/flutter (30500): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:55)
E/flutter (30500): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/flutter (30500): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/flutter (30500): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/flutter (30500): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/flutter (30500): at android.os.Handler.handleCallback(Handler.java:938)
E/flutter (30500): at android.os.Handler.dispatchMessage(Handler.java:99)
E/flutter (30500): at android.os.Looper.loopOnce(Looper.java:211)
E/flutter (30500): at android.os.Looper.loop(Looper.java:300)
E/flutter (30500): at android.app.ActivityThread.main(ActivityThread.java:8322)
E/flutter (30500): at java.lang.reflect.Method.invoke(Native Method)
E/flutter (30500): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
E/flutter (30500): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1038)
E/flutter (30500): )
E/flutter (30500): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:651:7)
E/flutter (30500): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:322:18)
E/flutter (30500):
It is also possible to use Mapbox? annotations, such as distance max speed ...
@Hermit90 This seems to be a bug, to temporarily fix this you can just pass a value for the 'longPressDestinationEnabled' settings, which is part of the 'MapBoxOptions' you pass to the MapBoxNavigationView widget.
The issue is cause by the package assuming this will have a value, but it is nullable so this isn't always the case.
Stale issue message