flutter_mapbox_navigation icon indicating copy to clipboard operation
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

Open XxMenotoxX opened this issue 2 years ago • 95 comments

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.

XxMenotoxX avatar Jun 22 '23 09:06 XxMenotoxX

Is this an embedded Nav view? Does the view Id and app Id match your app?

eopeter avatar Jun 22 '23 10:06 eopeter

i dont know what is view Id and app Id

XxMenotoxX avatar Jun 22 '23 10:06 XxMenotoxX

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

wbilalz400 avatar Jun 22 '23 13:06 wbilalz400

I don't know if you're using lib "Location" but it's crashing.

TicketMarketTecnologia avatar Jun 22 '23 19:06 TicketMarketTecnologia

I do actually use location lib as an alternative way to track user location

XxMenotoxX avatar Jun 22 '23 19:06 XxMenotoxX

Try https://pub.dev/packages/geolocator and replace the location lib

TicketMarketTecnologia avatar Jun 22 '23 19:06 TicketMarketTecnologia

I use both geo locator and locatin

XxMenotoxX avatar Jun 22 '23 19:06 XxMenotoxX

+1

nnadir35 avatar Jun 23 '23 10:06 nnadir35

but I also get this error only when using google_map. maybe the google_map package is causing this issue

nnadir35 avatar Jun 23 '23 10:06 nnadir35

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 avatar Jun 23 '23 10:06 XxMenotoxX

@XxMenotoxX Did you remove the google map library and mapbox is working perfectly?

wbilalz400 avatar Jun 23 '23 10:06 wbilalz400

Yes i did but i will try again on an empty project to see if i encounter the same issue

XxMenotoxX avatar Jun 23 '23 10:06 XxMenotoxX

@XxMenotoxX I am trying to remove google map library as well to check

wbilalz400 avatar Jun 23 '23 10:06 wbilalz400

Same issue even when google maps are removed. It's a weird issue since it always happens at the 3rd time.

wbilalz400 avatar Jun 23 '23 10:06 wbilalz400

same issue too , weird issue indeed @wbilalz400

XxMenotoxX avatar Jun 23 '23 12:06 XxMenotoxX

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.

alexeileyvamora avatar Jun 23 '23 16:06 alexeileyvamora

any updates? the same error

AhmadMajd9 avatar Jul 03 '23 11:07 AhmadMajd9

Did any one find the fix?

mckeny3 avatar Jul 27 '23 12:07 mckeny3

still looking for a solution and i have a production app for a client any alternatives

ARA-ZET avatar Aug 03 '23 16:08 ARA-ZET

I can take a look at it tonight. Can you list the exact steps to replicate?

eopeter avatar Aug 03 '23 16:08 eopeter

@eopeter here are my steps to replicate on Android, either simulator or device:

  1. Load my navigation page / widget.
  2. Build route and start navigation.
  3. Stop navigation.
  4. Unload Widget that includes map / navigate back to previous page.
  5. 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.

rkreager avatar Aug 03 '23 16:08 rkreager

its basically the same step to me as well, after repeating 3 times the app close

ARA-ZET avatar Aug 03 '23 17:08 ARA-ZET

I am not able to replicate this with the example app: https://youtu.be/-q8gwWmGdRM

eopeter avatar Aug 05 '23 08:08 eopeter

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.

mckeny3 avatar Aug 05 '23 15:08 mckeny3

hi @eopeter did you find any solution for the problem sir

XxMenotoxX avatar Sep 12 '23 08:09 XxMenotoxX

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.

  1. Load the navigation screen and navigate.
  2. Cancel the navigation/ Finish the navigation.
  3. Go back to search screen and navigate again.
  4. The app crash

Here is the crash report:

image

maicojay16 avatar Sep 12 '23 23:09 maicojay16

Hello @eopeter is there any solutions or updates sir? Thank you.

maicojay16 avatar Sep 13 '23 22:09 maicojay16

is this issue still happening with the current version 0.2.0?

eopeter avatar Sep 25 '23 12:09 eopeter

@eopeter I will try it with version 0.2.0 and report back.

rkreager avatar Sep 25 '23 12:09 rkreager

@eopeter i will try the new version 0.2.0 and will give a feedback thanks for the response.

maicojay16 avatar Sep 29 '23 09:09 maicojay16