fix(map): revert app-side Maps SDK init to library-idiomatic, fix inline-map crash#5719
Merged
Merged
Conversation
…ine-map crash structurally The late-May/early-June crash-fix flurry introduced app-side MapsInitializer calls from Compose to work around a "BitmapDescriptorFactory is not initialized" crash on the node-detail inline map (#5709), then extended it to the main map (#5715). maps-compose initializes the SDK itself when a GoogleMap creates its MapView, and the idiom is to build BitmapDescriptors inside a live map. Initializing from Compose (ahead of / racing the MapView's own init) correlates with the LATEST-renderer vector base map rendering black on affected devices ("Normal" black while satellite/terrain/hybrid render fine). Open-tag bisection of a field report (fine at open.16/17, black at open.20) places the inline-map regression at open.19 and the main-map regression at open.20. Revert to the pre-flurry, library-idiomatic initialization: - delete MapsSdkInitializer; remove all app-side MapsInitializer calls (the MapView init LaunchedEffect and MarkerBitmapRenderer's ensureMapsInitialized; buildNodeChipDescriptor drops its now-unused Context param) - fix the inline-map crash structurally: build the marker descriptor inside InlineMap's GoogleMap content, where the SDK is already initialized, exactly like the main map (which never crashed) - drop the redundant play-services-maps version pin; maps-compose pulls 20.0.0 transitively via maps-ktx Every descriptor build site now sits inside a live map, so no app-side init is needed and the crash cannot recur. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
9eeaa63 to
874e29e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reverts the app-side Google Maps SDK initialization added during the recent crash-fix flurry back to the maps-compose-idiomatic approach, and fixes the node-detail inline-map crash structurally.
Background
maps-composeinitializes the Maps SDK itself when aGoogleMapcreates itsMapView; the documented idiom is to buildBitmapDescriptors inside a live map. The flurry added app-sideMapsInitializercalls from Compose to work around aBitmapDescriptorFactory-not-initialized crash on the node-detail inline map (#5709), then extended the pattern to the main map (#5715).Initializing the SDK from Compose — ahead of / racing the
GoogleMap's own init — correlates with the LATEST-renderer vector base map rendering black on affected devices: "Normal" renders black while satellite/terrain/hybrid (raster) render fine. Open-tag bisection of a field report (fine atopen.16/open.17, black atopen.20) places the inline-map regression atopen.19and the main-map regression atopen.20.Changes
MapsSdkInitializer; remove all app-sideMapsInitializercalls (theMapViewinitLaunchedEffectandMarkerBitmapRenderer.ensureMapsInitialized;buildNodeChipDescriptordrops its now-unusedContextparam).InlineMap'sGoogleMapcontent, where the SDK is already initialized — exactly like the main map, which never crashed.play-services-mapsversion pin;maps-composepulls20.0.0transitively viamaps-ktx.Every descriptor build site (main-map overlays, the cluster renderer via
MapEffect, waypoints, and the inline map) now sits inside a live map, so no app-side init is needed and the crash cannot recur.Verification
spotlessCheck,detekt,assembleDebug(google + fdroid),test, andallTestspass locally. The device-specific LATEST-renderer black map cannot be reproduced on an emulator; this change is a strict revert to the pre-flurry initialization that worked, plus an idiomatic crash fix.🤖 Generated with Claude Code