Hi. Does anyone having `java.lang.IllegalStateExce...
# compose
t
Hi. Does anyone having
java.lang.IllegalStateException: pending composition has not been applied
with compose 1.1.0? . Full stack trace in 🧵
Copy code
2022-02-18 10:19:33.290 32538-32538/com.golftec.mppc E/AndroidRuntime:     at androidx.compose.foundation.layout.FillModifier$measure$1.invoke(Size.kt:662)
        at androidx.compose.ui.layout.MeasureScope$layout$1.placeChildren(MeasureScope.kt:68)
        at androidx.compose.ui.node.DelegatingLayoutNodeWrapper.placeAt-f8xVGno(DelegatingLayoutNodeWrapper.kt:126)
        at androidx.compose.ui.layout.Placeable.access$placeAt-f8xVGno(Placeable.kt:31)
        at androidx.compose.ui.layout.Placeable$PlacementScope.place-70tqf50(Placeable.kt:370)
        at androidx.compose.ui.node.OuterMeasurablePlaceable.placeOuterWrapper-f8xVGno(OuterMeasurablePlaceable.kt:170)
        at androidx.compose.ui.node.OuterMeasurablePlaceable.access$placeOuterWrapper-f8xVGno(OuterMeasurablePlaceable.kt:28)
        at androidx.compose.ui.node.OuterMeasurablePlaceable$placeAt$1.invoke(OuterMeasurablePlaceable.kt:158)
        at androidx.compose.ui.node.OuterMeasurablePlaceable$placeAt$1.invoke(OuterMeasurablePlaceable.kt:157)
        at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:1798)
        at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:121)
        at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:88)
        at androidx.compose.ui.node.OwnerSnapshotObserver.observeLayoutModifierSnapshotReads$ui_release(OwnerSnapshotObserver.kt:69)
        at androidx.compose.ui.node.OuterMeasurablePlaceable.placeAt-f8xVGno(OuterMeasurablePlaceable.kt:157)
        at androidx.compose.ui.node.OuterMeasurablePlaceable.replace(OuterMeasurablePlaceable.kt:182)
        at androidx.compose.ui.node.LayoutNode.replace$ui_release(LayoutNode.kt:855)
        at androidx.compose.ui.node.MeasureAndLayoutDelegate.remeasureAndRelayoutIfNeeded(MeasureAndLayoutDelegate.kt:234)
        at androidx.compose.ui.node.MeasureAndLayoutDelegate.access$remeasureAndRelayoutIfNeeded(MeasureAndLayoutDelegate.kt:38)
        at androidx.compose.ui.node.MeasureAndLayoutDelegate.measureAndLayout(MeasureAndLayoutDelegate.kt:201)
        at androidx.compose.ui.platform.AndroidComposeView.measureAndLayout(AndroidComposeView.android.kt:662)
        at androidx.compose.ui.node.Owner$DefaultImpls.measureAndLayout$default(Owner.kt:182)
        at androidx.compose.ui.platform.AndroidComposeView.dispatchDraw(AndroidComposeView.android.kt:846)
        at android.view.View.draw(View.java:23904)
        at android.view.View.updateDisplayListIfDirty(View.java:22776)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5320)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5292)
        at android.view.View.updateDisplayListIfDirty(View.java:22731)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5320)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5292)
        at android.view.View.updateDisplayListIfDirty(View.java:22731)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5320)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5292)
        at android.view.View.updateDisplayListIfDirty(View.java:22731)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5320)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5292)
        at android.view.View.updateDisplayListIfDirty(View.java:22731)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5320)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5292)
        at android.view.View.updateDisplayListIfDirty(View.java:22731)
        at android.view.View.draw(View.java:23631)
        at android.view.ViewGroup.drawChild(ViewGroup.java:5336)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5093)
        at android.view.View.draw(View.java:23904)
        at com.android.internal.policy.DecorView.draw(DecorView.java:1282)
        at android.view.View.updateDisplayListIfDirty(View.java:22776)
        at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:579)
        at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:585)
        at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:662)
        at android.view.ViewRootImpl.draw(ViewRootImpl.java:4994)
2022-02-18 10:19:33.291 32538-32538/com.golftec.mppc E/AndroidRuntime:     at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:4701)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3818)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2575)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9910)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1010)
        at android.view.Choreographer.doCallbacks(Choreographer.java:809)
        at android.view.Choreographer.doFrame(Choreographer.java:744)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:995)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:246)
        at android.app.ActivityThread.main(ActivityThread.java:8506)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
Copy code
java.lang.IllegalStateException: pending composition has not been applied
        at androidx.compose.runtime.CompositionImpl.drainPendingModificationsForCompositionLocked(Composition.kt:444)
        at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:477)
        at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:748)
        at androidx.compose.runtime.ComposerImpl$CompositionContextImpl.composeInitial$runtime_release(Composer.kt:2987)
        at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:433)
        at androidx.compose.ui.layout.SubcomposeLayoutState.subcomposeInto(SubcomposeLayout.kt:269)
        at androidx.compose.ui.layout.SubcomposeLayoutState.access$subcomposeInto(SubcomposeLayout.kt:154)
        at androidx.compose.ui.layout.SubcomposeLayoutState$subcompose$2.invoke(SubcomposeLayout.kt:244)
        at androidx.compose.ui.layout.SubcomposeLayoutState$subcompose$2.invoke(SubcomposeLayout.kt:241)
        at androidx.compose.runtime.snapshots.SnapshotStateObserver.withNoObservations(SnapshotStateObserver.kt:142)
        at androidx.compose.ui.node.OwnerSnapshotObserver.withNoSnapshotReadObservation$ui_release(OwnerSnapshotObserver.kt:55)
        at androidx.compose.ui.node.LayoutNode.withNoSnapshotReadObservation$ui_release(LayoutNode.kt:1175)
        at androidx.compose.ui.layout.SubcomposeLayoutState.subcompose(SubcomposeLayout.kt:241)
        at androidx.compose.ui.layout.SubcomposeLayoutState.subcompose(SubcomposeLayout.kt:235)
        at androidx.compose.ui.layout.SubcomposeLayoutState.subcompose$ui_release(SubcomposeLayout.kt:224)
        at androidx.compose.ui.layout.SubcomposeLayoutState$Scope.subcompose(SubcomposeLayout.kt:490)
        at androidx.compose.material.ScaffoldKt$ScaffoldLayout$1$1$1.invoke(Scaffold.kt:314)
        at androidx.compose.material.ScaffoldKt$ScaffoldLayout$1$1$1.invoke(Scaffold.kt:241)
        at androidx.compose.ui.layout.MeasureScope$layout$1.placeChildren(MeasureScope.kt:68)
        at androidx.compose.ui.layout.SubcomposeLayoutState$createMeasurePolicy$1$measure$1.placeChildren(SubcomposeLayout.kt:367)
        at androidx.compose.ui.node.LayoutNode$layoutChildren$1.invoke(LayoutNode.kt:993)
        at androidx.compose.ui.node.LayoutNode$layoutChildren$1.invoke(LayoutNode.kt:978)
        at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:126)
        at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:88)
        at androidx.compose.ui.node.OwnerSnapshotObserver.observeLayoutSnapshotReads$ui_release(OwnerSnapshotObserver.kt:62)
        at androidx.compose.ui.node.LayoutNode.layoutChildren$ui_release(LayoutNode.kt:978)
        at androidx.compose.ui.node.LayoutNode.onNodePlaced$ui_release(LayoutNode.kt:964)
        at androidx.compose.ui.node.InnerPlaceable.placeAt-f8xVGno(InnerPlaceable.kt:129)
        at androidx.compose.ui.layout.Placeable.access$placeAt-f8xVGno(Placeable.kt:31)
        at androidx.compose.ui.layout.Placeable$PlacementScope.place-70tqf50(Placeable.kt:370)
        at androidx.compose.ui.node.OuterMeasurablePlaceable.placeOuterWrapper-f8xVGno(OuterMeasurablePlaceable.kt:170)
        at androidx.compose.ui.node.OuterMeasurablePlaceable.access$placeOuterWrapper-f8xVGno(OuterMeasurablePlaceable.kt:28)
        at androidx.compose.ui.node.OuterMeasurablePlaceable$placeAt$1.invoke(OuterMeasurablePlaceable.kt:158)
        at androidx.compose.ui.node.OuterMeasurablePlaceable$placeAt$1.invoke(OuterMeasurablePlaceable.kt:157)
        at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:126)
        at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:88)
        at androidx.compose.ui.node.OwnerSnapshotObserver.observeLayoutModifierSnapshotReads$ui_release(OwnerSnapshotObserver.kt:69)
        at androidx.compose.ui.node.OuterMeasurablePlaceable.placeAt-f8xVGno(OuterMeasurablePlaceable.kt:157)
        at androidx.compose.ui.layout.Placeable.access$placeAt-f8xVGno(Placeable.kt:31)
2022-02-18 10:19:33.287 32538-32538/com.golftec.mppc E/AndroidRuntime:     at androidx.compose.ui.layout.Placeable$PlacementScope.place-70tqf50(Placeable.kt:370)
        at androidx.compose.ui.layout.Placeable$PlacementScope.place-70tqf50$default(Placeable.kt:203)
        at androidx.compose.foundation.layout.BoxKt.placeInBox(Box.kt:186)
        at androidx.compose.foundation.layout.BoxKt.access$placeInBox(Box.kt:1)
        at androidx.compose.foundation.layout.BoxKt$boxMeasurePolicy$1$measure$2.invoke(Box.kt:126)
        at androidx.compose.foundation.layout.BoxKt$boxMeasurePolicy$1$measure$2.invoke(Box.kt:125)
        at androidx.compose.ui.layout.MeasureScope$layout$1.placeChildren(MeasureScope.kt:68)
        at androidx.compose.ui.node.LayoutNode$layoutChildren$1.invoke(LayoutNode.kt:993)
        at androidx.compose.ui.node.LayoutNode$layoutChildren$1.invoke(LayoutNode.kt:978)
        at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:126)
        at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:88)
        at androidx.compose.ui.node.OwnerSnapshotObserver.observeLayoutSnapshotReads$ui_release(OwnerSnapshotObserver.kt:62)
        at androidx.compose.ui.node.LayoutNode.layoutChildren$ui_release(LayoutNode.kt:978)
        at androidx.compose.ui.node.LayoutNode.onNodePlaced$ui_release(LayoutNode.kt:964)
        at androidx.compose.ui.node.InnerPlaceable.placeAt-f8xVGno(InnerPlaceable.kt:129)
        at androidx.compose.ui.layout.Placeable.access$placeAt-f8xVGno(Placeable.kt:31)
        at androidx.compose.ui.layout.Placeable$PlacementScope.place-70tqf50(Placeable.kt:370)
        at androidx.compose.ui.layout.Placeable$PlacementScope.place-70tqf50$default(Placeable.kt:203)
        at androidx.compose.ui.node.DelegatingLayoutNodeWrapper$measure$1$1.placeChildren(DelegatingLayoutNodeWrapper.kt:138)
        at androidx.compose.ui.node.DelegatingLayoutNodeWrapper.placeAt-f8xVGno(DelegatingLayoutNodeWrapper.kt:126)
        at androidx.compose.ui.layout.Placeable.access$placeAt-f8xVGno(Placeable.kt:31)
        at androidx.compose.ui.layout.Placeable$PlacementScope.place-70tqf50(Placeable.kt:370)
        at androidx.compose.ui.layout.Placeable$PlacementScope.place-70tqf50$default(Placeable.kt:203)
        at androidx.compose.ui.node.DelegatingLayoutNodeWrapper$measure$1$1.placeChildren(DelegatingLayoutNodeWrapper.kt:138)
        at androidx.compose.ui.node.DelegatingLayoutNodeWrapper.placeAt-f8xVGno(DelegatingLayoutNodeWrapper.kt:126)
        at androidx.compose.ui.layout.Placeable.access$placeAt-f8xVGno(Placeable.kt:31)
        at androidx.compose.ui.layout.Placeable$PlacementScope.placeWithLayer(Placeable.kt:393)
        at androidx.compose.ui.layout.Placeable$PlacementScope.placeWithLayer$default(Placeable.kt:266)
        at androidx.compose.ui.graphics.SimpleGraphicsLayerModifier$measure$1.invoke(GraphicsLayerModifier.kt:308)
        at androidx.compose.ui.graphics.SimpleGraphicsLayerModifier$measure$1.invoke(GraphicsLayerModifier.kt:307)
        at androidx.compose.ui.layout.MeasureScope$layout$1.placeChildren(MeasureScope.kt:68)
        at androidx.compose.ui.node.DelegatingLayoutNodeWrapper.placeAt-f8xVGno(DelegatingLayoutNodeWrapper.kt:126)
        at androidx.compose.ui.layout.Placeable.access$placeAt-f8xVGno(Placeable.kt:31)
        at androidx.compose.ui.layout.Placeable$PlacementScope.place(Placeable.kt:367)
        at androidx.compose.ui.layout.Placeable$PlacementScope.place$default(Placeable.kt:191)
        at androidx.compose.foundation.layout.PaddingValuesModifier$measure$2.invoke(Padding.kt:422)
        at androidx.compose.foundation.layout.PaddingValuesModifier$measure$2.invoke(Padding.kt:421)
        at androidx.compose.ui.layout.MeasureScope$layout$1.placeChildren(MeasureScope.kt:68)
        at androidx.compose.ui.node.DelegatingLayoutNodeWrapper.placeAt-f8xVGno(DelegatingLayoutNodeWrapper.kt:126)
        at androidx.compose.ui.layout.Placeable.access$placeAt-f8xVGno(Placeable.kt:31)
        at androidx.compose.ui.layout.Placeable$PlacementScope.placeRelative(Placeable.kt:359)
        at androidx.compose.ui.layout.Placeable$PlacementScope.placeRelative$default(Placeable.kt:179)
        at androidx.compose.foundation.layout.FillModifier$measure$1.invoke(Size.kt:663)
c
Haven't seen that stacktrace before BUT since you mentioned you're using 1.1.0, have you tried 1.2.0-alpha03?
t
I’ll give it a try.
a
We've seen a few cases here and there where this exception results from the composition getting into a bad state after a previous exception occurred, check back a bit in your logs and see if there was an earlier exception
t
Yeah I just found out it was because of
java.lang.IllegalStateException: You cannot access the NavBackStackEntry's ViewModels after the NavBackStackEntry is destroyed.
It happens when I was switching to other app back and forth quickly
Now I have NPE out of no where with 1.1.0. I thought it was fixed on 1.1.0
Copy code
java.lang.NullPointerException
        at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:292)
        at androidx.compose.ui.platform.AndroidComposeView.dispatchDraw(AndroidComposeView.android.kt:857)
        at android.view.View.draw(View.java:23904)
        at android.view.View.updateDisplayListIfDirty(View.java:22776)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5320)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5292)
        at android.view.View.updateDisplayListIfDirty(View.java:22731)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5320)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5292)
        at android.view.View.updateDisplayListIfDirty(View.java:22731)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5320)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5292)
        at android.view.View.updateDisplayListIfDirty(View.java:22731)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5320)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5292)
        at android.view.View.updateDisplayListIfDirty(View.java:22731)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5320)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5292)
        at android.view.View.updateDisplayListIfDirty(View.java:22731)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5320)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5292)
        at android.view.View.updateDisplayListIfDirty(View.java:22731)
        at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:579)
        at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:585)
        at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:662)
        at android.view.ViewRootImpl.draw(ViewRootImpl.java:4994)
        at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:4701)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3818)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2575)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9910)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1010)
        at android.view.Choreographer.doCallbacks(Choreographer.java:809)
        at android.view.Choreographer.doFrame(Choreographer.java:744)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:995)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:246)
        at android.app.ActivityThread.main(ActivityThread.java:8506)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
E/MainActivityKt$MainContent: java.lang.NullPointerException
        at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:292)
        at androidx.compose.ui.platform.AndroidComposeView.dispatchDraw(AndroidComposeView.android.kt:857)
        at android.view.View.draw(View.java:23904)
        at android.view.View.updateDisplayListIfDirty(View.java:22776)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5320)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5292)
        at android.view.View.updateDisplayListIfDirty(View.java:22731)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5320)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5292)
        at android.view.View.updateDisplayListIfDirty(View.java:22731)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5320)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5292)
        at android.view.View.updateDisplayListIfDirty(View.java:22731)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5320)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5292)
        at android.view.View.updateDisplayListIfDirty(View.java:22731)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5320)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5292)
        at android.view.View.updateDisplayListIfDirty(View.java:22731)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:5320)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:5292)
        at android.view.View.updateDisplayListIfDirty(View.java:22731)
        at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:579)
        at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:585)
        at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:662)
        at android.view.ViewRootImpl.draw(ViewRootImpl.java:4994)
        at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:4701)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3818)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2575)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9910)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1010)
        at android.view.Choreographer.doCallbacks(Choreographer.java:809)
        at android.view.Choreographer.doFrame(Choreographer.java:744)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:995)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:246)
        at android.app.ActivityThread.main(ActivityThread.java:8506)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
a
t
Thanks Albert!
132 Views