Skip to content

Google Maps: sometimes the map is not displayed on startup #776

@GiuFio

Description

@GiuFio

After updating to version 6.10.0, we noticed unusual behaviour with Google Maps. Occasionally, the map fails to display. Upon debugging the library, I identified the likely cause. In GoogleMapsInitializer.initialize(), the coroutine sometimes gets cancelled when the code is suspended at the withContext block, and in the catch block, the state is set to InitializationState.FAILURE.

Image

Additionally, at the start of the initialize function, there's a state check that prevents reinitialization if the state is FAILURE, causing the map to remain hidden until the app is killed and restarted.

In my view, if the coroutine is cancelled during initialisation, the state should be set to InitializationState.UNINITIALIZED rather than InitializationState.FAILURE. Additionally, it should be possible to reinitialise the map after a failure without needing to call the reset function.

Environment details

OS type and version:

I reproduced the issue on the Pixel 9 Pro and Pixel Fold with Android 16, but we have also received reports from other devices and versions.

Library version and other environment information:

android-compose-map: 6.10.0

compose-bom: 2025.07.00

Metadata

Metadata

Assignees

Labels

type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions