Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when opening the map #584

Open
JeevanRupacha opened this issue Jun 18, 2024 · 6 comments
Open

Crash when opening the map #584

JeevanRupacha opened this issue Jun 18, 2024 · 6 comments
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@JeevanRupacha
Copy link

JeevanRupacha commented Jun 18, 2024

Environment details

  1. maps compose version 5.0.3
  2. Jetpack compose version 1.6.7
  3. Material3 version 1.2.1

Code example

GoogleMap(
            modifier = Modifier.fillMaxSize()
        ) {
            MapEffect(key1 = clusterItems) { map ->
}
}
)

Stack trace

android.net.ConnectivityManager$TooManyRequestsException
                                                                                                    	at android.net.ConnectivityManager.convertServiceException(ConnectivityManager.java:4165)
                                                                                                    	at android.net.ConnectivityManager.sendRequestForNetwork(ConnectivityManager.java:4357)
                                                                                                    	at android.net.ConnectivityManager.sendRequestForNetwork(ConnectivityManager.java:4364)
                                                                                                    	at android.net.ConnectivityManager.registerNetworkCallback(ConnectivityManager.java:4746)
                                                                                                    	at android.net.ConnectivityManager.registerNetworkCallback(ConnectivityManager.java:4716)
                                                                                                    	at m.fef.c(:com.google.android.gms.policy_maps_core_dynamite@[email protected]:41)
                                                                                                    	at m.fef.<init>(:com.google.android.gms.policy_maps_core_dynamite@[email protected]:140)
                                                                                                    	at com.google.maps.api.android.lib6.impl.ib.<init>(:com.google.android.gms.policy_maps_core_dynamite@[email protected]:7)
                                                                                                    	at com.google.android.gms.maps.internal.CreatorImpl.d(:com.google.android.gms.policy_maps_core_dynamite@[email protected]:1151)
                                                                                                    	at com.google.android.gms.maps.internal.CreatorImpl.logInitialization(:com.google.android.gms.policy_maps_core_dynamite@[email protected]:60)
                                                                                                    	at com.google.android.gms.maps.internal.i.bq(:com.google.android.gms.policy_maps_core_dynamite@[email protected]:73)
                                                                                                    	at m.bcw.onTransact(:com.google.android.gms.policy_maps_core_dynamite@[email protected]:21)
                                                                                                    	at android.os.Binder.transact(Binder.java:1183)
                                                                                                    	at com.google.android.gms.internal.maps.zza.zzc(com.google.android.gms:play-services-maps@@18.2.0:2)
                                                                                                    	at com.google.android.gms.maps.internal.zze.zzl(com.google.android.gms:play-services-maps@@18.2.0:4)
                                                                                                    	at com.google.android.gms.maps.MapsInitializer.initialize(com.google.android.gms:play-services-maps@@18.2.0:12)
                                                                                                    	at com.google.android.gms.maps.MapsInitializer.initialize(com.google.android.gms:play-services-maps@@18.2.0:1)
                                                                                                    	at com.google.android.gms.maps.zzai.zzb(com.google.android.gms:play-services-maps@@18.2.0:2)
                                                                                                    	at com.google.android.gms.maps.zzai.createDelegate(com.google.android.gms:play-services-maps@@18.2.0:1)
                                                                                                    	at com.google.android.gms.dynamic.DeferredLifecycleHelper.zaf(com.google.android.gms:play-services-base@@18.3.0:6)
                                                                                                    	at com.google.android.gms.dynamic.DeferredLifecycleHelper.onCreate(com.google.android.gms:play-services-base@@18.3.0:1)
                                                                                                    	at com.google.android.gms.maps.MapView.onCreate(com.google.android.gms:play-services-maps@@18.2.0:4)
                                                                                                    	at com.google.maps.android.compose.GoogleMapKt.lifecycleObserver$lambda$12(GoogleMap.kt:209)
                                                                                                    	at com.google.maps.android.compose.GoogleMapKt.$r8$lambda$OyhSHZmxT3lf78-uP6q1KJOt96o(Unknown Source:0)
                                                                                                    	at com.google.maps.android.compose.GoogleMapKt$$ExternalSyntheticLambda0.onStateChanged(Unknown Source:4)
                                                                                                    	at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.kt:322)
                                                                                                    	at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.kt:199)
                                                                                                    	at com.google.maps.android.compose.GoogleMapKt$MapLifecycle$1.invoke(GoogleMap.kt:184)
                                                                                                    	at com.google.maps.android.compose.GoogleMapKt$MapLifecycle$1.invoke(GoogleMap.kt:180)
                                                                                                    	at androidx.compose.runtime.DisposableEffectImpl.onRemembered(Effects.kt:83)
                                                                                                    	at androidx.compose.runtime.CompositionImpl$RememberEventDispatcher.dispatchRememberObservers(Composition.kt:1295)
                                                                                                    	at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:984)
                                                                                                    	at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:1005)
                                                                                                    	at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:1099)
                                                                                                    	at androidx.compose.runtime.ComposerImpl$CompositionContextImpl.composeInitial$runtime_release(Composer.kt:3599)
                                                                                                    	at androidx.compose.runtime.ComposerImpl$CompositionContextImpl.composeInitial$runtime_release(Composer.kt:3599)
                                                                                                    	at androidx.compose.runtime.CompositionImpl.composeInitial(Composition.kt:633)

Thanks!

@JeevanRupacha JeevanRupacha added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jun 18, 2024
@kikoso
Copy link
Collaborator

kikoso commented Jun 18, 2024

Hi @JeevanRupacha ,

The error strack trace does not seem to be related to the code snippet. Are you doing something else besides trying to cluster, like executing a network call?

@JeevanRupacha
Copy link
Author

JeevanRupacha commented Jun 18, 2024

@kikoso I am doing clustering based on already fetched data. I mean even I didn't do any clustering and just run the only above code I got crash. By the way this crash happens when I try to open google map quickly after app launch and if I wait minute or more and execute then works very fine.

Just This code:

GoogleMap(){{}

@Xlopec
Copy link

Xlopec commented Aug 15, 2024

I have the same issue with maps compose 6.1.1, compose 1.6.10, kotlin 2.0.0. App just hangs for a second and then crashes with the same stacktrace

private val StaticMapUi = MapUiSettings(
    zoomControlsEnabled = false,
    zoomGesturesEnabled = false,
    compassEnabled = false,
    indoorLevelPickerEnabled = false,
    mapToolbarEnabled = false,
    myLocationButtonEnabled = false,
    rotationGesturesEnabled = false,
    scrollGesturesEnabled = false,
    scrollGesturesEnabledDuringRotateOrZoom = false,
    tiltGesturesEnabled = false
)

...
@Composable
fun Test() {
    Column {
        ....
        val markerPosition = LatLng(20.0, 20.0)
        val cameraPositionState = rememberCameraPositionState {
            position = CameraPosition.fromLatLngZoom(markerPosition, MapZoom)
        }

        GoogleMap(
            cameraPositionState = cameraPositionState,
            modifier = Modifier.Companion
                .fillMaxWidth()
                .height(RestaurantMapHeight)
                .clip(MaterialTheme.shapes.large),
            uiSettings = StaticMapUi,
        ) {
            Marker(
                state = MarkerState(position = markerPosition),
            )
        }
        ....
    }
}

@superbattery
Copy link

same here.

@maximality
Copy link

maximality commented Aug 21, 2024

We experience the same issue:

https://byairapp-sl.sentry.io/share/issue/7a338366b2a24cc5b451e9bb5e5260d1/

upd:
Our issue was not related to google maps itself.
We use coil for loading images.
For each image we have a custom image loader (for a puprose).
And it happened that way, each image loader request inits network observer by default.
100+ images initiate the same amount of network observers whech leads to the crash when user opens google map (which registers own network observer).

@Leeyunje
Copy link

I have the same problem.

If you do not open the map for more than 15 minutes after running the app, the above conflict will occur.

There are currently two collisions: m.fdy.c and m.feb.c.

Below is my stack.

  1. m.fdy.c
  • Fatal Exception: android.net.ConnectivityManager$TooManyRequestsException: at android.net.ConnectivityManager.convertServiceException(ConnectivityManager.java:4236) at android.net.ConnectivityManager.sendRequestForNetwork(ConnectivityManager.java:4437) at android.net.ConnectivityManager.sendRequestForNetwork(ConnectivityManager.java:4444) at android.net.ConnectivityManager.registerNetworkCallback(ConnectivityManager.java:4826) at android.net.ConnectivityManager.registerNetworkCallback(ConnectivityManager.java:4796) at m.fdy.c(:com.google.android.gms.policy_maps_core_dynamite@[email protected]:29) at com.google.maps.api.android.lib6.impl.q.b(:com.google.android.gms.policy_maps_core_dynamite@[email protected]:29) at com.google.maps.api.android.lib6.impl.co.aZ(:com.google.android.gms.policy_maps_core_dynamite@[email protected]:3) at com.google.maps.api.android.lib6.impl.co.D(:com.google.android.gms.policy_maps_core_dynamite@[email protected]:32) at com.google.maps.api.android.lib6.impl.ek.k(:com.google.android.gms.policy_maps_core_dynamite@[email protected]:11) at com.google.android.gms.maps.internal.r.dispatchTransaction(:com.google.android.gms.policy_maps_core_dynamite@[email protected]:14) at m.bco.onTransact(:com.google.android.gms.policy_maps_core_dynamite@[email protected]:13) at android.os.Binder.transact(Binder.java:1190) at com.google.android.gms.internal.maps.zza.zzc(com.google.android.gms:play-services-maps@@19.0.0:2) at com.google.android.gms.maps.internal.zzl.onStart(com.google.android.gms:play-services-maps@@19.0.0:2) at com.google.android.gms.maps.zzah.onStart(com.google.android.gms:play-services-maps@@19.0.0:1) at com.google.android.gms.dynamic.zaf.zab(com.google.android.gms:play-services-base@@18.4.0:1) at com.google.android.gms.dynamic.DeferredLifecycleHelper.zaf(com.google.android.gms:play-services-base@@18.4.0:1) at com.google.android.gms.dynamic.DeferredLifecycleHelper.onStart(com.google.android.gms:play-services-base@@18.4.0:1) at com.google.android.gms.maps.MapView.onStart(com.google.android.gms:play-services-maps@@19.0.0:1) at com.google.maps.android.compose.GoogleMapKt.lifecycleObserver$lambda$12(GoogleMap.kt:214) at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.kt:314) at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.kt:192) at com.google.maps.android.compose.GoogleMapKt$MapLifecycle$1.invoke(GoogleMap.kt:185) at com.google.maps.android.compose.GoogleMapKt$MapLifecycle$1.invoke(GoogleMap.kt:181) at androidx.compose.runtime.DisposableEffectImpl.onRemembered(Effects.kt:83) at androidx.compose.runtime.CompositionImpl$RememberEventDispatcher.dispatchRememberObservers(Composition.kt:1295) at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:984) at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:1005) at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:639) at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:551) at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:41) at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109) at androidx.compose.ui.platform.AndroidUiDispatcher.access$setScheduledFrameDispatch$p(AndroidUiDispatcher.android.kt) at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt) at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1666) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1677) at android.view.Choreographer.doCallbacks(Choreographer.java:1190) at android.view.Choreographer.doFrame(Choreographer.java:1056) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1647) at android.os.Handler.handleCallback(Handler.java:958) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:222) at android.os.Looper.loop(Looper.java:314) at android.app.ActivityThread.main(ActivityThread.java:8602) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:565) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
  1. m.feb.c
  • Fatal Exception: android.net.ConnectivityManager$TooManyRequestsException: at android.net.ConnectivityManager.convertServiceException(ConnectivityManager.java:4236) at android.net.ConnectivityManager.sendRequestForNetwork(ConnectivityManager.java:4437) at android.net.ConnectivityManager.sendRequestForNetwork(ConnectivityManager.java:4444) at android.net.ConnectivityManager.registerNetworkCallback(ConnectivityManager.java:4826) at android.net.ConnectivityManager.registerNetworkCallback(ConnectivityManager.java:4796) at m.feb.c(:com.google.android.gms.policy_maps_core_dynamite@[email protected]:29) at m.feb.(:com.google.android.gms.policy_maps_core_dynamite@[email protected]:140) at com.google.maps.api.android.lib6.impl.hw.(:com.google.android.gms.policy_maps_core_dynamite@[email protected]:6) at com.google.android.gms.maps.internal.CreatorImpl.b(:com.google.android.gms.policy_maps_core_dynamite@[email protected]:1142) at com.google.android.gms.maps.internal.CreatorImpl.logInitialization(:com.google.android.gms.policy_maps_core_dynamite@[email protected]:16) at com.google.android.gms.maps.internal.i.dispatchTransaction(:com.google.android.gms.policy_maps_core_dynamite@[email protected]:73) at m.bdb.onTransact(:com.google.android.gms.policy_maps_core_dynamite@[email protected]:13) at android.os.Binder.transact(Binder.java:1067) at com.google.android.gms.internal.maps.zza.zzc(com.google.android.gms:play-services-maps@@19.0.0:2) at com.google.android.gms.maps.internal.zze.zzl(com.google.android.gms:play-services-maps@@19.0.0:4) at com.google.android.gms.maps.MapsInitializer.initialize(com.google.android.gms:play-services-maps@@19.0.0:12) at com.google.android.gms.maps.MapsInitializer.initialize(com.google.android.gms:play-services-maps@@19.0.0:1) at com.google.android.gms.maps.zzai.zzb(com.google.android.gms:play-services-maps@@19.0.0:2) at com.google.android.gms.maps.zzai.createDelegate(com.google.android.gms:play-services-maps@@19.0.0:1) at com.google.android.gms.dynamic.DeferredLifecycleHelper.zaf(com.google.android.gms:play-services-base@@18.4.0:6) at com.google.android.gms.dynamic.DeferredLifecycleHelper.onCreate(com.google.android.gms:play-services-base@@18.4.0:1) at com.google.android.gms.maps.MapView.onCreate(com.google.android.gms:play-services-maps@@19.0.0:4) at com.google.maps.android.compose.GoogleMapKt.lifecycleObserver$lambda$12(GoogleMap.kt:210) at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.kt:314) at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.kt:192) at com.google.maps.android.compose.GoogleMapKt$MapLifecycle$1.invoke(GoogleMap.kt:185) at com.google.maps.android.compose.GoogleMapKt$MapLifecycle$1.invoke(GoogleMap.kt:181) at androidx.compose.runtime.DisposableEffectImpl.onRemembered(Effects.kt:83) at androidx.compose.runtime.CompositionImpl$RememberEventDispatcher.dispatchRememberObservers(Composition.kt:1295) at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:984) at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:1005) at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:639) at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:551) at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:41) at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109) at androidx.compose.ui.platform.AndroidUiDispatcher.access$setScheduledFrameDispatch$p(AndroidUiDispatcher.android.kt) at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt) at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1127) at android.view.Choreographer.doCallbacks(Choreographer.java:918) at android.view.Choreographer.doFrame(Choreographer.java:824) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1112) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:241) at android.os.Looper.loop(Looper.java:342) at android.app.ActivityThread.main(ActivityThread.java:8131) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:583) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1045)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

6 participants