flutter_mapbox_navigation
flutter_mapbox_navigation copied to clipboard
i have a driving app that use google_maps and mapbox navigation as a navigation map but my app crash when the mapbox navigation is called 3 times
here is the the error i get
FATAL EXCEPTION: main
E/AndroidRuntime(26642): Process: com.example.delivery_app, PID: 26642
E/AndroidRuntime(26642): java.lang.NullPointerException: Missing required view with ID: com.example.delivery_app:id/maneuverView
E/AndroidRuntime(26642): at com.mapbox.navigation.dropin.databinding.MapboxManeuverGuidanceLayoutBinding.bind(MapboxManeuverGuidanceLayoutBinding.java:60)
E/AndroidRuntime(26642): at com.mapbox.navigation.dropin.maneuver.ManeuverViewBinder.bind(ManeuverViewBinder.kt:27)
E/AndroidRuntime(26642): at com.mapbox.navigation.dropin.maneuver.ManeuverViewBinder.bind(ManeuverViewBinder.kt:16)
E/AndroidRuntime(26642): at com.mapbox.navigation.ui.base.lifecycle.UICoordinator$onAttached$1$invokeSuspend$$inlined$collect$1.emit(Collect.kt:136)
E/AndroidRuntime(26642): at kotlinx.coroutines.flow.FlowKt__ZipKt$combine$$inlined$combineUnsafe$FlowKt__ZipKt$1$2.invokeSuspend(Zip.kt:333)
E/AndroidRuntime(26642): at kotlinx.coroutines.flow.FlowKt__ZipKt$combine$$inlined$combineUnsafe$FlowKt__ZipKt$1$2.invoke(Unknown Source:13)
E/AndroidRuntime(26642): at kotlinx.coroutines.flow.FlowKt__ZipKt$combine$$inlined$combineUnsafe$FlowKt__ZipKt$1$2.invoke(Unknown Source:6)
E/AndroidRuntime(26642): at kotlinx.coroutines.flow.internal.CombineKt$combineInternal$2.invokeSuspend(Combine.kt:79)
E/AndroidRuntime(26642): at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
E/AndroidRuntime(26642): at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
E/AndroidRuntime(26642): at android.os.Handler.handleCallback(Handler.java:938)
E/AndroidRuntime(26642): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(26642): at android.os.Looper.loopOnce(Looper.java:211)
E/AndroidRuntime(26642): at android.os.Looper.loop(Looper.java:300)
E/AndroidRuntime(26642): at android.app.ActivityThread.main(ActivityThread.java:8322)
E/AndroidRuntime(26642): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(26642): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
E/AndroidRuntime(26642): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1038)
E/AndroidRuntime(26642): Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@8c69d01, Dispatchers.Main]
W/le.delivery_app(26642): type=1400 audit(0.0:24965): avc: denied { search } for name="mqsas" dev="sda11" ino=211 scontext=u:r:untrusted_app:s0:c223,c258,c512,c768 tcontext=u:object_r:mqsas_data_file:s0 tclass=dir permissive=0 app=com.example.delivery_app
W/OOMEventManagerFK(26642): Failed to mkdir /data/mqsas/hprof/
W/System (26642): A resource failed to call close.
W/le.delivery_app(26642): type=1400 audit(0.0:24966): avc: denied { search } for name="mqsas" dev="sda11" ino=211 scontext=u:r:untrusted_app:s0:c223,c258,c512,c768 tcontext=u:object_r:mqsas_data_file:s0 tclass=dir permissive=0 app=com.example.delivery_app
W/le.delivery_app(26642): type=1400 audit(0.0:24967): avc: denied { search } for name="mqsas" dev="sda11" ino=211 scontext=u:r:untrusted_app:s0:c223,c258,c512,c768 tcontext=u:object_r:mqsas_data_file:s0 tclass=dir permissive=0 app=com.example.delivery_app
W/le.delivery_app(26642): type=1400 audit(0.0:24968): avc: denied { search } for name="mqsas" dev="sda11" ino=211 scontext=u:r:untrusted_app:s0:c223,c258,c512,c768 tcontext=u:object_r:mqsas_data_file:s0 tclass=dir permissive=0 app=com.example.delivery_app
W/le.delivery_app(26642): type=1400 audit(0.0:24969): avc: denied { getattr } for path="/data/mqsas" dev="sda11" ino=211 scontext=u:r:untrusted_app:s0:c223,c258,c512,c768 tcontext=u:object_r:mqsas_data_file:s0 tclass=dir permissive=0 app=com.example.delivery_app
W/le.delivery_app(26642): type=1400 audit(0.0:24970): avc: denied { search } for name="mqsas" dev="sda11" ino=211 scontext=u:r:untrusted_app:s0:c223,c258,c512,c768 tcontext=u:object_r:mqsas_data_file:s0 tclass=dir permissive=0 app=com.example.delivery_app
I/Process (26642): Sending signal. PID: 26642 SIG: 9
Lost connection to device.
Is this an embedded Nav view? Does the view Id and app Id match your app?
i dont know what is view Id and app Id
having similar issue yes this is an embedded nav view. The app id does matches the one with our id. no idea what is view id
I don't know if you're using lib "Location" but it's crashing.
I do actually use location lib as an alternative way to track user location
Try https://pub.dev/packages/geolocator and replace the location lib
I use both geo locator and locatin
+1
but I also get this error only when using google_map. maybe the google_map package is causing this issue
One of the approaches that i tried to make is to delete the mapbox navigation lib and see if the google map lib is the cause of the problem everything went alright and i didn't encounter any issues related
@XxMenotoxX Did you remove the google map library and mapbox is working perfectly?
Yes i did but i will try again on an empty project to see if i encounter the same issue
@XxMenotoxX I am trying to remove google map library as well to check
Same issue even when google maps are removed. It's a weird issue since it always happens at the 3rd time.
same issue too , weird issue indeed @wbilalz400
The same thing happens to me in embedded view and always at the third time call. Also when I define mapStyleUrlNight: "mapbox://styles/mapbox/traffic-night-v2" and mapStyleUrlDay: "mapbox://styles/mapbox/traffic-day-v2" the specified style does not change. Android.
any updates? the same error
Did any one find the fix?
still looking for a solution and i have a production app for a client any alternatives
I can take a look at it tonight. Can you list the exact steps to replicate?
@eopeter here are my steps to replicate on Android, either simulator or device:
- Load my navigation page / widget.
- Build route and start navigation.
- Stop navigation.
- Unload Widget that includes map / navigate back to previous page.
- Repeat steps 1-4 a few more times and the crash will occur.
Here is the crash report:
E/AndroidRuntime(28909): FATAL EXCEPTION: main
E/AndroidRuntime(28909): Process: com.saferoutz.driver, PID: 28909
E/AndroidRuntime(28909): java.lang.NullPointerException: Missing required view with ID: com.saferoutz.driver:id/maneuverView
E/AndroidRuntime(28909): at com.mapbox.navigation.dropin.databinding.MapboxManeuverGuidanceLayoutBinding.bind(MapboxManeuverGuidanceLayoutBinding.java:60)
E/AndroidRuntime(28909): at com.mapbox.navigation.dropin.maneuver.ManeuverViewBinder.bind(ManeuverViewBinder.kt:27)
E/AndroidRuntime(28909): at com.mapbox.navigation.dropin.maneuver.ManeuverViewBinder.bind(ManeuverViewBinder.kt:16)
E/AndroidRuntime(28909): at com.mapbox.navigation.ui.base.lifecycle.UICoordinator$onAttached$1$invokeSuspend$$inlined$collect$1.emit(Collect.kt:136)
E/AndroidRuntime(28909): at kotlinx.coroutines.flow.FlowKt__ZipKt$combine$$inlined$combineUnsafe$FlowKt__ZipKt$1$2.invokeSuspend(Zip.kt:333)
E/AndroidRuntime(28909): at kotlinx.coroutines.flow.FlowKt__ZipKt$combine$$inlined$combineUnsafe$FlowKt__ZipKt$1$2.invoke(Unknown Source:13)
E/AndroidRuntime(28909): at kotlinx.coroutines.flow.FlowKt__ZipKt$combine$$inlined$combineUnsafe$FlowKt__ZipKt$1$2.invoke(Unknown Source:6)
E/AndroidRuntime(28909): at kotlinx.coroutines.flow.internal.CombineKt$combineInternal$2.invokeSuspend(Combine.kt:79)
E/AndroidRuntime(28909): at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
E/AndroidRuntime(28909): at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
E/AndroidRuntime(28909): at android.os.Handler.handleCallback(Handler.java:938)
E/AndroidRuntime(28909): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(28909): at android.os.Looper.loopOnce(Looper.java:226)
E/AndroidRuntime(28909): at android.os.Looper.loop(Looper.java:313)
E/AndroidRuntime(28909): at android.app.ActivityThread.main(ActivityThread.java:8751)
E/AndroidRuntime(28909): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(28909): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
E/AndroidRuntime(28909): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
E/AndroidRuntime(28909): Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@41982b8, Dispatchers.Main]
Happy to provide more details if needed.
its basically the same step to me as well, after repeating 3 times the app close
I am not able to replicate this with the example app: https://youtu.be/-q8gwWmGdRM
Thanks for looking into this...So it's in the embedded mode....so i would assign the driver coords as the first way point then the origin of the rider as the second way point....driver then navigate to the rider successfully....driver then swipe arrived ,then swipe to head to the rider destination..in this step I make sure to clear the route first ...then assign the driver location as the first way point then the rider coords as the second waypoint...then route get draw...then as driver hit navigate button...it crashes....if you reopen the app and assign the same way points from state it doesn't crash ....so that's tell you nothing is wrong with the route.
hi @eopeter did you find any solution for the problem sir
I also got the same problem when using the navigation.
Mine works well in the first run, But after that when i try to navigate again the app crash.
- Load the navigation screen and navigate.
- Cancel the navigation/ Finish the navigation.
- Go back to search screen and navigate again.
- The app crash
Here is the crash report:
Hello @eopeter is there any solutions or updates sir? Thank you.
is this issue still happening with the current version 0.2.0?
@eopeter I will try it with version 0.2.0 and report back.
@eopeter i will try the new version 0.2.0 and will give a feedback thanks for the response.