googlemaps / googlemaps/android-maps-compose
Google Maps Wont restoreState properly when using restoreState = true while navigating.
- Dominant language
- Kotlin
- Stars
- 1.3k
- Forks
- 181
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 18
Description
#### Environment details
1. Library: com.google.maps.android:maps-compose:6.2.0
2. Navigation library: androidx.navigation:navigation-compose:2.7.7
#### Steps to reproduce
1. Clone this [repo](https://github.com/Del-S/MapIssue).
2. Add google api key to manifest file.
3. Navigate to Map screen and then try to navigate to Map screen again.
#### Observation
Lifecycle observer goes to `ON_DESTROY` and never makes it's way to `ON_RESUME`, which keeps the map in "destroyed" state and it is not usable (cannot scroll, zoom or anything else).
While not using `restoreState` or `saveState` set to `true` the map works fine. Also when downgrading compose map library to `6.0.0` it works properly.
It might be related to already resolved issue: https://github.com/googlemaps/android-maps-compose/issues/112. But due to refactor in https://github.com/googlemaps/android-maps-compose/pull/436 it probably happens again. Not really connected to animations this time. It is probably connected to the restoreState.
Sample [video](https://github.com/user-attachments/assets/b1311720-4b43-4b49-9ed2-efe2e5999ddd) of the issue.
Contributor guide
Assessment
This issue has not been assessed yet.