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

StrictMode violation: StrictMode.assertConfigurationContext #612

Open
yogurtearl opened this issue Aug 14, 2024 · 0 comments
Open

StrictMode violation: StrictMode.assertConfigurationContext #612

yogurtearl opened this issue Aug 14, 2024 · 0 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

@yogurtearl
Copy link

yogurtearl commented Aug 14, 2024

Maps Compose version 6.1.1

with StrictMode detectIncorrectContextUse() via:

        StrictMode.setVmPolicy(
            VmPolicy.Builder()
                .detectAll()
                .penaltyLog()
                .build()
        )

gives this error:

Tried to access the API:ViewConfiguration which needs to have proper configuration from a non-UI Context:com.myCorp.android.DebugmyCorpApplication@a8821a7 The API:ViewConfiguration needs a proper configuration. Use UI contexts such as an activity or a context created via createWindowContext(Display, int, Bundle) or  createConfigurationContext(Configuration) with a proper configuration.
java.lang.IllegalAccessException: Tried to access the API:ViewConfiguration which needs to have proper configuration from a non-UI Context:com.myCorp.android.DebugmyCorpApplication@a8821a7
	at android.os.StrictMode.assertConfigurationContext(StrictMode.java:2349)
	at android.view.ViewConfiguration.get(ViewConfiguration.java:604)
	at android.view.View.<init>(View.java:5817)
	at android.view.TextureView.<init>(TextureView.java:220)
	at com.google.maps.api.android.lib6.gmm6.vector.av.<init>(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):1)
	at com.google.maps.api.android.lib6.gmm6.vector.ac.<init>(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):7)
	at com.google.maps.api.android.lib6.gmm6.api.ac.<init>(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):1)
	at com.google.maps.api.android.lib6.impl.bk.aF(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):97)
	at com.google.maps.api.android.lib6.impl.cu.d(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):11)
	at com.google.android.gms.maps.internal.q.bd(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):158)
	at m.ef.onTransact(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (190400-0):21)
	at android.os.Binder.transact(Binder.java:1345)
	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.onCreate(com.google.android.gms:play-services-maps@@19.0.0:3)
	at com.google.android.gms.maps.zzah.onCreate(com.google.android.gms:play-services-maps@@19.0.0:3)
	at com.google.android.gms.dynamic.zac.zab(com.google.android.gms:play-services-base@@18.4.0:1)
	at com.google.android.gms.dynamic.zaa.onDelegateCreated(com.google.android.gms:play-services-base@@18.4.0:3)
	at com.google.android.gms.maps.zzai.zzb(com.google.android.gms:play-services-maps@@19.0.0:5)
	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.MapLifecycleEventObserver.invokeEvent(GoogleMap.kt:359)
	at com.google.maps.android.compose.MapLifecycleEventObserver.moveUp(GoogleMap.kt:354)
	at com.google.maps.android.compose.MapLifecycleEventObserver.moveToLifecycleState(GoogleMap.kt:339)
	at com.google.maps.android.compose.MapLifecycleEventObserver.onStateChanged(GoogleMap.kt:316)
	at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.jvm.kt:320)
	at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.jvm.kt:198)
	at com.google.maps.android.compose.GoogleMapKt$GoogleMap$3$1$1$onAttachStateListener$1.onViewAttachedToWindow(GoogleMap.kt:168)
	at android.view.View.dispatchAttachedToWindow(View.java:22885)
	at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3496)
	at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3503)
	at android.view.ViewGroup.addViewInner(ViewGroup.java:5344)
	at android.view.ViewGroup.addView(ViewGroup.java:5130)
	at android.view.ViewGroup.addView(ViewGroup.java:5070)
	at android.view.ViewGroup.addView(ViewGroup.java:5042)
	at androidx.compose.ui.platform.AndroidComposeView.addAndroidView(AndroidComposeView.android.kt:1132)
	at androidx.compose.ui.viewinterop.AndroidViewHolder$layoutNode$1$3.invoke(AndroidViewHolder.android.kt:378)
	at androidx.compose.ui.viewinterop.AndroidViewHolder$layoutNode$1$3.invoke(AndroidViewHolder.android.kt:377)
	at androidx.compose.ui.node.LayoutNode.attach$ui_release(LayoutNode.kt:510)
	at androidx.compose.ui.node.LayoutNode.attach$ui_release(LayoutNode.kt:500)
	at androidx.compose.ui.node.LayoutNode.attach$ui_release(LayoutNode.kt:500)
	at androidx.compose.ui.node.LayoutNode.attach$ui_release(LayoutNode.kt:500)
	at androidx.compose.ui.node.LayoutNode.insertAt$ui_release(LayoutNode.kt:316)
	at androidx.compose.ui.node.UiApplier.insertBottomUp(UiApplier.android.kt:31)
	at androidx.compose.ui.node.UiApplier.insertBottomUp(UiApplier.android.kt:21)
	at androidx.compose.runtime.changelist.Operation$PostInsertNodeFixup.execute(Operation.kt:619)
	at androidx.compose.runtime.changelist.Operations.executeAndFlushAllPendingOperations(Operations.kt:309)
	at androidx.compose.runtime.changelist.FixupList.executeAndFlushAllPendingFixups(FixupList.kt:50)
	at androidx.compose.runtime.changelist.Operation$InsertSlotsWithFixups.execute(Operation.kt:550)
	at androidx.compose.runtime.changelist.Operations.executeAndFlushAllPendingOperations(Operations.kt:309)
	at androidx.compose.runtime.changelist.ChangeList.executeAndFlushAllPendingChanges(ChangeList.kt:81)
	at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:984)
	at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:1013)
	at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:685)
	at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:585)
	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$performFrameDispatch(AndroidUiDispatcher.android.kt:41)
	at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1404)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1415)
	at android.view.Choreographer.doCallbacks(Choreographer.java:1015)
	at android.view.Choreographer.doFrame(Choreographer.java:941)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1389)
	at android.os.Handler.handleCallback(Handler.java:959)
	at android.os.Handler.dispatchMessage(Handler.java:100)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.app.ActivityThread.main(ActivityThread.java:8674)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
@yogurtearl yogurtearl 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 Aug 14, 2024
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

1 participant