Repository navigation
Lite mode crash "setMapColorScheme not supported in Lite mode" regressed in 8.6.0 (#601) #1028
Description
Activity
- addedtype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.triage meI really want to be triaged.I really want to be triaged.
on Oct 7, 2026 - addedpriority: p0Highest priority. Critical issue. P0 implies highest priority.Highest priority. Critical issue. P0 implies highest priority.and removedtriage meI really want to be triaged.I really want to be triaged.
on Oct 7, 2026 Hi there! Thank you so much for opening this issue and providing such an exceptionally detailed breakdown, root-cause analysis, and version comparison matrix across the Play services maps modules. This makes tracking down and addressing the problem so much easier!
You are completely right: while newer versions of the Google Play services Maps module silently ignore
setMapColorSchemein Lite mode, older versions still throwUnsupportedOperationExceptionboth duringMapView.onCreate(viaGoogleMapOptions) and when updating the property viaMapUpdater. ReintroducingFOLLOW_SYSTEMas the default parameter in #986 unintentionally exposed Lite mode maps on those older devices to this crash.Proposed Fix
Your proposed resolution makes total sense:
- In
GoogleMap.kt(inside theAndroidViewfactory), avoid settingmapColorSchemeonGoogleMapOptionsifopts.liteMode == true. - In
MapUpdater.kt, guard theset(mapColorScheme)block so thatmap.mapColorScheme = itis skipped when the map is in Lite mode (e.g., usingcameraPositionState.isLiteMode).
This ensures full-feature maps continue to follow the system theme by default, while Lite mode maps remain stable across all versions of Google Play services without throwing exceptions.
Workaround
For anyone encountering this issue on versions
8.6.0through9.0.0, settingmapColorScheme = nullexplicitly when initializing a Lite mode map bypasses both assignment paths and prevents the crash:GoogleMap( modifier = Modifier.size(108.dp, 76.dp), cameraPositionState = rememberCameraPositionState { position = CameraPosition.fromLatLngZoom(LatLng(35.681236, 139.767125), 13f) }, googleMapOptionsFactory = { GoogleMapOptions().liteMode(true) }, mapColorScheme = null // Explicitly pass null to prevent crashes on older Play services )
(Note: As mentioned in
docs/lite-mode-dark-theme.md, if you need dark theme support in Lite mode, you can apply custom styling viaMapProperties(mapStyleOptions = ...)instead).
Would you be interested in submitting a pull request with the fix you outlined? We'd be more than happy to review it! Otherwise, the maintainers will get a patch prepared and tested based on your proposal.
Thanks again for the fantastic report!
- In
- added a commit that references this issue
on Oct 7, 2026 - added a commit that references this issue
on Oct 8, 2026
Environment details
GoogleMapwithGoogleMapOptions().liteMode(true))com.google.maps.android:maps-compose:8.6.0(the relevant code is unchanged in 9.0.0),com.google.android.gms:play-services-maps:20.0.0The crash depends on the Google Play services maps module version on the device:
policy_maps_core_dynamite)So most devices are fine, but devices whose Play services have not been updated for a while crash every time a Lite mode map is shown.
Steps to reproduce
GoogleMapin Lite mode without passingmapColorScheme(the default).To reproduce on an emulator: create an AVD from the API 35 Google Play system image, which ships Play services 24.23.35, and do not sign in to a Google account so Play services is not updated.
The bundled
LiteModeActivitysample does not passmapColorSchemeeither, so it goes through the same code path.Cause
This looks like a regression of #601, which was fixed by #603 (removing the default
MapColorScheme).#986 made
FOLLOW_SYSTEMthe default again, for a good reason (maps without an explicitmapColorSchemewere stuck in light mode), but the change also reaches Lite mode maps:GoogleMap.kt: theAndroidViewfactory (added in fix(maps-compose): apply mapColorScheme to GoogleMapOptions during MapView creation #976) writesmapColorSchemeintoGoogleMapOptionswhengoogleMapOptionsFactorydid not set it, regardless ofliteMode.MapUpdater.kt:set(mapColorScheme)callsmap.mapColorScheme = itwhenever the value is non-null, regardless ofliteMode.Lite mode does not support map color schemes (Lite mode docs).
Recent Play services ignore the call, but older ones throw
UnsupportedOperationException, either atMapView.onCreate(from the options) or at theMapUpdatersetter.docs/lite-mode-dark-theme.md(#989) says the SDK ignoresMapColorSchemefor Lite mode maps, which only holds on recent Play services.Proposed fix
Keep
FOLLOW_SYSTEMas the default from #986, and skip the color scheme only for Lite mode maps:AndroidViewfactory, applymapColorSchemetoGoogleMapOptionsonly whenopts.liteMode != true.MapUpdater, skipmap.mapColorScheme = itwhen the map is in Lite mode (the factory already setscameraPositionState.isLiteMode).Non-Lite maps keep following the system theme, and Lite mode maps behave the same on every Play services version as they already do on recent ones.
A try/catch around
setMapColorSchemewould not be enough, because with maps module 25.34 the crash happens insideMapView.onCreatefrom the options.Lite mode maps that should follow the theme can keep using
mapStyleOptions, as described indocs/lite-mode-dark-theme.md.Workaround until fixed: pass
mapColorScheme = nullexplicitly for Lite mode maps.Code example
Stack trace
Production device, maps module 25.34 (crashes at
MapView.onCreate):Emulator, maps module 24.16 (crashes at the
MapUpdatersetter):Thanks!