Open KamalDesignOWeb opened 9 months ago
The same happens to me
@eopeter Do you know how to solve this problem we have?
Looking into this to see how I can replicate it
When using embedded navigation, and start navigation several times. I have this error message in the logs:
"[BUG] Two simultaneous active navigation sessions. This might happen if there are two NavigationViewController or RouteController instances exists at the same time. Profile the app and make sure that NavigationViewController is deallocated once not in use."
and the UI become unstable, map continually moves, and even, after several navigation start, app crash when arriving at a waypoint.
Looking at RoutesCoordinator
in MapboxCoreNavigation
it looks like a call to RouteController.finishRouting()
clean the current ActiveNavigationSession UUID.
Adding a call to self._navigationViewController?.navigationService.router.finishRouting()
in NavigationFactory.endNavigation
make the UI stable again. No more map moves or crash so far.
But I still get the BUG message in the logs, which is weird and I don't understand. I'll keep investigating when I have a bit of time.
How did you guys fix this without editing the library?
https://github.com/eopeter/flutter_mapbox_navigation/assets/132433990/609eee06-bdea-402c-ae2e-1a8bbf60c993