Skip to content

[Bug]: CarPlay map freezes when the iPhone is locked (CarPlay GMSMapView not bound to the CarPlay screen) #739

Description

@IvelinKrastev

Is there an existing issue for this?

  • I have searched the existing issues

Description of the bug

On Apple CarPlay, the navigation map's location puck and camera freeze the moment the iPhone display sleeps (auto-lock or the lock button), even though turn-by-turn guidance keeps running. The cause: the plugin creates the CarPlay GMSMapView without setting GMSMapViewOptions.screen to the CarPlay screen, so the map renders off the iPhone main screen's display link — which iOS halts when the iPhone display sleeps. The Google Navigation SDK explicitly documents that CarPlay map views must set this property.

From https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSMapViewOptions:

The screen the view will be used on.
Defaults to the main screen. Should be set to the CarPlay screen if this map view is to be used with CarPlay.

Flutter version

3.44.4

Package version

0.9.4

Native SDK versions

  • I haven't changed the version of the native SDKs

Flutter Doctor Output

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.44.4, on macOS 26.5.1 25F80 darwin-arm64, locale en-BG)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 26.6)
[✓] Chrome - develop for the web
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!

Steps to reproduce

  1. Build a CarPlay navigation app using BaseCarSceneDelegate (e.g. the plugin's example).
  2. Connect to CarPlay, start guidance, confirm the puck follows and the camera tracks.
  3. Lock the iPhone (press the lock button) or let it auto-lock — i.e. turn the iPhone screen off while CarPlay stays connected.

Expected vs Actual Behavior

Expected

The CarPlay map keeps animating — puck moves, camera follows — while the iPhone is locked (the behavior of Apple Maps / Google Maps / Waze on CarPlay).

Actual

  • The CarPlay map freezes: the puck stops moving and the camera stops following; it looks like the vehicle isn't moving.
  • Turn-by-turn nav info and ETA keep updating correctly during the freeze.
  • Briefly waking the iPhone screen without unlocking (a single tap to light it) makes the map instantly resync to the live position; letting the screen sleep again re-freezes it. This is reproducible 100% of the time and is the key diagnostic.

Code Sample

The Google Navigation SDK provides the exact remedy as a GMSMapViewOptions property (GMSMapViewOptions+Navigation.h):

@property(nonatomic, null_resettable) UIScreen *screen;
"The screen the view will be used on. Defaults to the main screen. Should be set to the CarPlay screen if this map view is to be used with CarPlay."

The plugin never sets it for the CarPlay map. In GoogleMapsNavigationView.init (ios/.../GoogleMapsNavigationView.swift, ~L118–120):

let mapViewOptions = GMSMapViewOptions()
_mapConfiguration.apply(to: mapViewOptions, withFrame: frame)   // sets camera, frame, mapID — NOT screen
_mapView = ViewStateAwareGMSMapView(options: mapViewOptions)    // → defaults to UIScreen.main

MapConfiguration.apply(to:withFrame:) (MapConfiguration.swift, ~L73) sets camera, frame, and mapID only — never screen. And BaseCarSceneDelegate.createVC() constructs the view with frame: templateApplicationScene.carWindow.screen.bounds and isCarPlayView: true, but does not pass the CarPlay UIScreen through, so screen stays at its UIScreen.main default.

Net: even though the plugin already knows this is a CarPlay view and has templateApplicationScene.carWindow.screen in hand, the documented CarPlay requirement is missed.

Additional Context

No response

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions