Skip to content

GoogleMap composable does not reattempt initialization on failure #828

@ryancfogarty

Description

@ryancfogarty

Thanks for stopping by to let us know something could be better!


PLEASE READ

If you have a support contract with Google, please create an issue in the support console. This will ensure a timely response.

Discover additional support services for the Google Maps Platform, including developer communities, technical guidance, and expert support at the Google Maps Platform support resources page.

If your bug or feature request is not related to this particular library, please visit the Google Maps Platform issue trackers.

Check for answers on StackOverflow with the google-maps tag.


Please be sure to include as much information as possible:

Environment details

  1. Specify the API at the beginning of the title (for example, "Places: ...")
  2. OS type and version
  3. Library version and other environment information

Steps to reproduce

Hard to reproduce this reliably, but it's clear by looking at the code that the GoogleMap composable does not reattempt initialization when it fails.

val googleMapsInitializer = LocalGoogleMapsInitializer.current
val initializationState by googleMapsInitializer.state
if (initializationState != InitializationState.SUCCESS) {
val context = LocalContext.current
LaunchedEffect(Unit) {
// Coroutine to initialize Google Maps SDK.
// This will run once when the composable is first displayed.
googleMapsInitializer.initialize(context)
}
}

Recently there was a change that set the InitializerState back to UNINITIALIZED when initialization failed. Since this composable isn't leveraging that, it can get in a state where it never initializes properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage meI really want to be triaged.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