Sluglet-Team / SlugletApp

A UCSC student resources app
Apache License 2.0
0 stars 1 forks source link

App crashes when pressing the square window changing tab when on the map screen. #20

Closed cfbeard closed 10 months ago

cfbeard commented 11 months ago

The error is as follows:

java.lang.RuntimeException: Parcel: unable to marshal value com.sluglet.slugletapp.OSMaps.CameraPositionState@a8a4a9a

Something about trying to navigate away from the app when on the map screen causes the crash.

cfbeard commented 11 months ago

Just a guess but this could be the issue in MapViewModle.kt. I found a post saying that using jetpack composes saveable can mess with Parcelables.


    var cameraState: CameraPositionState by savedStateHandle.saveable {
        mutableStateOf(
            CameraPositionState(
                CameraProperty(
                    // 36°59'44.5"N 122°03'35.5"W
                    // Starting point and zoom for the map
                    geoPoint = GeoPoint(36.99582810669116, -122.05824150361903),
                    zoom = 15.5
                )
            )
        )
    }```
cfbeard commented 10 months ago

Issue fixed, it was indeed the above code snippet.