You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I'm using Xcode 14.3.1 with an iOS 16.4 simulator. I've also seen this issue on a physical device.
Run the Example-CarPlay project.
Disable route simulation.
Set the simulator on the "Freeway Drive" location.
Drop a pin anywhere and start navigation with a CarPlay window active.
Occasionally tap the map to open the navigation bar and/or open the feedback UI.
Keep an eye on the current street label and camera's position relative to the user puck.
Safe.Areas.mov
Expected behavior
The leading and trailing safe area insets stay consistent and don't briefly change values.
Actual behavior
Every so often, the CarPlayNavigationViewController's viewSafeAreaInsetsDidChange gets called with incorrect/unexpected insets that don't account for the necessary horizontal safe areas of the CarPlay window. When this happens, the map's camera will center the puck on the whole screen, causing it to partially draw under the maneuver UI. The current street label will also draw underneath the maneuver UI.
This seems to arise more frequently when the navigation bar is presented after tapping on the screen or after dismissing the feedback UI. After a moment, viewSafeAreaInsetsDidChange will be called with the expected values and the UI will correct itself.
I'm not sure if this is something related to the SDK itself, or if this is a bug within Apple's CarPlay framework. I'm curious if anyone has leads. I've seen this issue within the Mapbox Navigation SDK inside my own CarPlay app as well, which does not have a feedback button and instead displays a pan button at that position.
I've been able to capture the bug in logs by inserting one print statement in CarPlayNavigationViewController:
publicoverridefunc viewSafeAreaInsetsDidChange(){...<existing implementation here>...print("Safe area insets did change \(view.safeAreaInsets)")}
Using the default CarPlay simulator size:
when the UI is acting as expected, the edge insets looks like UIEdgeInsets(top: 44.0, left: 195.0, bottom: 0.0, right: 38.0)
when the bug arises, the insets change to UIEdgeInsets(top: 44.0, left: 45.0, bottom: 0.0, right: 0.0).
You can see the horizontal safe area is incorrect, particularly on the left side. Thank you for the assistance!
Is this a one-time issue or a repeatable issue?
repeatable
The text was updated successfully, but these errors were encountered:
Hi, @johnnewman, and thank you for reporting this one and making your own investigation! We'll take a look on that issue and update the ticket when it's done
Hi, I also use CarPlay navigation in my app, and had a similar issue where the safeAreaLayout changed repeatedly without actually presenting anything on the screen to motivate the change. In my case it only happened after I started and ended a first navigation session. So it worked as expected the first navigation, and every navigation henceforth caused numerous viewSafeAreaInsetsChanged() calls.
The problem was memory leaks in the navigation sessions handling. The sessions weren't cleared up after finishing, causing multiple map updates. So if I started a navigation, ended it, and started a new one, I was beeing fed updates for two ongoing navigations, which seems to have been the root cause for the safeAreaLayout changes. I don't use Mapbox but thought it might be the same anyways. Hope this helps someone.
Mapbox Navigation SDK version
2.13.0 and 2.11.0
Steps to reproduce
Hello! I'm using Xcode 14.3.1 with an iOS 16.4 simulator. I've also seen this issue on a physical device.
Keep an eye on the current street label and camera's position relative to the user puck.
Safe.Areas.mov
Expected behavior
The leading and trailing safe area insets stay consistent and don't briefly change values.
Actual behavior
Every so often, the CarPlayNavigationViewController's
viewSafeAreaInsetsDidChange
gets called with incorrect/unexpected insets that don't account for the necessary horizontal safe areas of the CarPlay window. When this happens, the map's camera will center the puck on the whole screen, causing it to partially draw under the maneuver UI. The current street label will also draw underneath the maneuver UI.This seems to arise more frequently when the navigation bar is presented after tapping on the screen or after dismissing the feedback UI. After a moment,
viewSafeAreaInsetsDidChange
will be called with the expected values and the UI will correct itself.I'm not sure if this is something related to the SDK itself, or if this is a bug within Apple's CarPlay framework. I'm curious if anyone has leads. I've seen this issue within the Mapbox Navigation SDK inside my own CarPlay app as well, which does not have a feedback button and instead displays a pan button at that position.
I've been able to capture the bug in logs by inserting one print statement in CarPlayNavigationViewController:
Using the default CarPlay simulator size:
UIEdgeInsets(top: 44.0, left: 195.0, bottom: 0.0, right: 38.0)
UIEdgeInsets(top: 44.0, left: 45.0, bottom: 0.0, right: 0.0)
.You can see the horizontal safe area is incorrect, particularly on the left side. Thank you for the assistance!
Is this a one-time issue or a repeatable issue?
repeatable
The text was updated successfully, but these errors were encountered: