Hi,
I started to make an app using this package and everything is working fine.
However when I try to set a value to mapStyleUrlDay and/or to mapStyleUrlNight in the MapBoxOptions widget and then start a turn by turn navigation my app crashes.
I tried on Galaxy A5, Galaxy A8, and Redmi note 10 phones.
As soon as I start the navigation by clicking on "Start A to B" the app crashes.
And then i get this error:
D/AndroidRuntime( 5007): Shutting down VM E/AndroidRuntime( 5007): FATAL EXCEPTION: main E/AndroidRuntime( 5007): Process: com.example.mapbox_turn_by_turn, PID: 5007 E/AndroidRuntime( 5007): java.lang.IllegalStateException: Calling addImage when a newer style is loading/has loaded. E/AndroidRuntime( 5007): at com.mapbox.mapboxsdk.maps.Style.validateState(Style.java:786) E/AndroidRuntime( 5007): at com.mapbox.mapboxsdk.maps.Style.addImage(Style.java:378) E/AndroidRuntime( 5007): at com.mapbox.mapboxsdk.maps.Style.addImage(Style.java:319) E/AndroidRuntime( 5007): at com.mapbox.mapboxsdk.location.SymbolLocationLayerRenderer.addBitmaps(SymbolLocationLayerRenderer.java:225) E/AndroidRuntime( 5007): at com.mapbox.mapboxsdk.location.LocationLayerController.styleBitmaps(LocationLayerController.java:196) E/AndroidRuntime( 5007): at com.mapbox.mapboxsdk.location.LocationLayerController.setRenderMode(LocationLayerController.java:123) E/AndroidRuntime( 5007): at com.mapbox.mapboxsdk.location.LocationComponent.setRenderMode(LocationComponent.java:716) E/AndroidRuntime( 5007): at com.mapbox.navigation.ui.map.NavigationMapboxMap.updateLocationLayerRenderMode(NavigationMapboxMap.java:543) E/AndroidRuntime( 5007): at com.dormmom.flutter_mapbox_navigation.activity.NavigationActivity.buildAndStartNavigation(NavigationActivity.kt:142) E/AndroidRuntime( 5007): at com.dormmom.flutter_mapbox_navigation.activity.NavigationActivity.access$buildAndStartNavigation(NavigationActivity.kt:57) E/AndroidRuntime( 5007): at com.dormmom.flutter_mapbox_navigation.activity.NavigationActivity$routeRequestCallBack$1.onRoutesReady(NavigationActivity.kt:344) E/AndroidRuntime( 5007): at com.mapbox.navigation.core.directions.session.MapboxDirectionsSession$requestRoutes$1.onResponse(MapboxDirectionsSession.kt:85) E/AndroidRuntime( 5007): at com.mapbox.navigation.route.internal.hybrid.MapboxHybridRouter$RouterHandler.onResponse(MapboxHybridRouter.kt:124) E/AndroidRuntime( 5007): at com.mapbox.navigation.route.internal.offboard.MapboxOffboardRouter$getRoute$1.onResponse(MapboxOffboardRouter.kt:66) E/AndroidRuntime( 5007): at com.mapbox.api.directions.v5.MapboxDirections$1.onResponse(MapboxDirections.java:186) E/AndroidRuntime( 5007): at retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall$1.lambda$onResponse$0$DefaultCallAdapterFactory$ExecutorCallbackCall$1(DefaultCallAdapterFactory.java:81) E/AndroidRuntime( 5007): at retrofit2.-$$Lambda$DefaultCallAdapterFactory$ExecutorCallbackCall$1$hVGjmafRi6VitDIrPNdoFizVAdk.run(Unknown Source:6) E/AndroidRuntime( 5007): at android.os.Handler.handleCallback(Handler.java:789) E/AndroidRuntime( 5007): at android.os.Handler.dispatchMessage(Handler.java:98) E/AndroidRuntime( 5007): at android.os.Looper.loop(Looper.java:164) E/AndroidRuntime( 5007): at android.app.ActivityThread.main(ActivityThread.java:6944) E/AndroidRuntime( 5007): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime( 5007): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) E/AndroidRuntime( 5007): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) V/Mbgl-HttpRequest( 5007): [HTTP] Request was successful (code = 200). D/Mbgl-HttpRequest( 5007): [HTTP] This request was cancelled ([https://api.mapbox.com/styles/v1/mapbox/dark-v10?access_token=pk.[my_private_key]&sku=108l05qvubaf33c2032c9ef43ba9596ff0e9e83e6a0]()). This is expected for tiles that were being prefetched but are no longer needed for the map to render. Lost connection to device. Exited (sigterm)
Hi, I started to make an app using this package and everything is working fine. However when I try to set a value to mapStyleUrlDay and/or to mapStyleUrlNight in the MapBoxOptions widget and then start a turn by turn navigation my app crashes.
I have tried with the example provided here : https://github.com/eopeter/flutter_mapbox_navigation/tree/master/example/lib And I set mapStyleUrlDay and mapStyleUrlNight to MapboxStyles.DARK
I tried on Galaxy A5, Galaxy A8, and Redmi note 10 phones. As soon as I start the navigation by clicking on "Start A to B" the app crashes.
And then i get this error:
D/AndroidRuntime( 5007): Shutting down VM E/AndroidRuntime( 5007): FATAL EXCEPTION: main E/AndroidRuntime( 5007): Process: com.example.mapbox_turn_by_turn, PID: 5007 E/AndroidRuntime( 5007): java.lang.IllegalStateException: Calling addImage when a newer style is loading/has loaded. E/AndroidRuntime( 5007): at com.mapbox.mapboxsdk.maps.Style.validateState(Style.java:786) E/AndroidRuntime( 5007): at com.mapbox.mapboxsdk.maps.Style.addImage(Style.java:378) E/AndroidRuntime( 5007): at com.mapbox.mapboxsdk.maps.Style.addImage(Style.java:319) E/AndroidRuntime( 5007): at com.mapbox.mapboxsdk.location.SymbolLocationLayerRenderer.addBitmaps(SymbolLocationLayerRenderer.java:225) E/AndroidRuntime( 5007): at com.mapbox.mapboxsdk.location.LocationLayerController.styleBitmaps(LocationLayerController.java:196) E/AndroidRuntime( 5007): at com.mapbox.mapboxsdk.location.LocationLayerController.setRenderMode(LocationLayerController.java:123) E/AndroidRuntime( 5007): at com.mapbox.mapboxsdk.location.LocationComponent.setRenderMode(LocationComponent.java:716) E/AndroidRuntime( 5007): at com.mapbox.navigation.ui.map.NavigationMapboxMap.updateLocationLayerRenderMode(NavigationMapboxMap.java:543) E/AndroidRuntime( 5007): at com.dormmom.flutter_mapbox_navigation.activity.NavigationActivity.buildAndStartNavigation(NavigationActivity.kt:142) E/AndroidRuntime( 5007): at com.dormmom.flutter_mapbox_navigation.activity.NavigationActivity.access$buildAndStartNavigation(NavigationActivity.kt:57) E/AndroidRuntime( 5007): at com.dormmom.flutter_mapbox_navigation.activity.NavigationActivity$routeRequestCallBack$1.onRoutesReady(NavigationActivity.kt:344) E/AndroidRuntime( 5007): at com.mapbox.navigation.core.directions.session.MapboxDirectionsSession$requestRoutes$1.onResponse(MapboxDirectionsSession.kt:85) E/AndroidRuntime( 5007): at com.mapbox.navigation.route.internal.hybrid.MapboxHybridRouter$RouterHandler.onResponse(MapboxHybridRouter.kt:124) E/AndroidRuntime( 5007): at com.mapbox.navigation.route.internal.offboard.MapboxOffboardRouter$getRoute$1.onResponse(MapboxOffboardRouter.kt:66) E/AndroidRuntime( 5007): at com.mapbox.api.directions.v5.MapboxDirections$1.onResponse(MapboxDirections.java:186) E/AndroidRuntime( 5007): at retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall$1.lambda$onResponse$0$DefaultCallAdapterFactory$ExecutorCallbackCall$1(DefaultCallAdapterFactory.java:81) E/AndroidRuntime( 5007): at retrofit2.-$$Lambda$DefaultCallAdapterFactory$ExecutorCallbackCall$1$hVGjmafRi6VitDIrPNdoFizVAdk.run(Unknown Source:6) E/AndroidRuntime( 5007): at android.os.Handler.handleCallback(Handler.java:789) E/AndroidRuntime( 5007): at android.os.Handler.dispatchMessage(Handler.java:98) E/AndroidRuntime( 5007): at android.os.Looper.loop(Looper.java:164) E/AndroidRuntime( 5007): at android.app.ActivityThread.main(ActivityThread.java:6944) E/AndroidRuntime( 5007): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime( 5007): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) E/AndroidRuntime( 5007): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) V/Mbgl-HttpRequest( 5007): [HTTP] Request was successful (code = 200). D/Mbgl-HttpRequest( 5007): [HTTP] This request was cancelled ([https://api.mapbox.com/styles/v1/mapbox/dark-v10?access_token=pk.[my_private_key]&sku=108l05qvubaf33c2032c9ef43ba9596ff0e9e83e6a0]()). This is expected for tiles that were being prefetched but are no longer needed for the map to render. Lost connection to device. Exited (sigterm)
I hope some one will be abble to help :)