flutter_mapbox_navigation: 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.

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 88 (16 by maintainers)

Most upvoted comments

Thanks for digging into this. Would definitely like a solution that others can refer to when they encounter this issue.

I tested with version 0.2.0 but the problem is the same, after finishing the route it keeps working and sending information, even leaving the screen it was on and returning to the app’s main screen it continues transmitting information. See below that it has finished the route section and continues arriving in the MapBoxEvent.progress_change method

currentLegDistanceRemaining: 0.0 W/Mapbox (30124): [nav-native]: Using the same old location with timestamp = 858841291852758ns, lng = -46.502187, lat = -23.430765 for 10 seconds E/Mapbox (30124): [nav-sdk]: [MapboxFollowingFrameProcessor] Start position is beyond line

When you return to the main screen of the app, it sends the message below, one after the other:

E/Mapbox (30124): [nav-sdk]: [MapboxFollowingFrameProcessor] Start position is beyond line I/stem.br_expres(30124): Explicit concurrent copying GC freed 5579(287KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 8693KB/16MB, paused 303us total 89.885ms two E/Mapbox (30124): [nav-sdk]: [MapboxFollowingFrameProcessor] Start position is beyond line W/Mapbox (30124): [nav-native]: Using the same old location with timestamp = 858841291852758ns, lng = -46.502187, lat = -23.430765 for 80 seconds E/Mapbox (30124): [nav-sdk]: [MapboxFollowingFrameProcessor] Start position is beyond line I/stem.br_expres(30124): Explicit concurrent copying GC freed 5582(304KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 8741KB/17MB, paused 584us total 106.255ms two E/Mapbox (30124): [nav-sdk]: [MapboxFollowingFrameProcessor] Start position is beyond line I/stem.br_expres(30124): Explicit concurrent copying GC freed 6239(335KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 8709KB/17MB, paused 146us total 61,031ms

@marciotisouza I got the same status if I do not invoke the finishNavigation() After I invoked the finishNavigation() [*without clearRoute()], it could stop to fire MapBoxEvent.progress_change and show MapBoxEvent.navigation_cancelled

But it will not able to receive the MapBoxEvent.progress_change anymore… So that the ManeuverView becomes blank…

@eopeter Could you please look into this issue. We would really appreciate it?

@eopeter I watched your video https://www.youtube.com/watch?v=-q8gwWmGdRM What is the button click step?

Build Route > Start > ? > Build Route > Start > ? > etc

I am now trying to use the GlobalKey and AutomaticKeepAliveClientMixin The result is the Map will only create one, and the route can draw But the navigation will not start even when I invoked startNavigation() It will keep firing event navigation_cancel

More interesting are,

  1. The ManeuverView will not have any information inside when manuelly click the bottom start navigation button in the MapView
  2. The clearRoute() and startFreeDrive() will not return anything if I use “await”, so that I cannot clearRoute() if I keep the widget alive

(And sometimes I get a memory leak…😂

I hope this can help to investigate 🙏🏻

Certo, combinado !!!

@marciotisouza e @ddiegosousa vamos sim agora as 17:30 no chat

Will do and get back to you

is this issue still happening with the current version 0.2.0?