Status Update
Comments
lu...@livefront.com <lu...@livefront.com> #2
I'm getting the same error today
pe...@abc.net.au <pe...@abc.net.au> #3
Any chance you could provide a way to repro this crash?
ae...@google.com <ae...@google.com> #4
Andrey, could you verify if this is the same root cause as
BTW, the question in #3 was meant for folks who made
ry...@charter.com <ry...@charter.com> #5
ae...@google.com <ae...@google.com> #6
I have a way to repro inside my app but not yet fully back to try to extract something I can share.
I just quickly tested latest SNAPSHOT (10683443) and now the error is different and requires a lot more scrolls to trigger.
java.lang.IllegalStateException: LayoutNode should be attached to an owner
at androidx.compose.ui.node.LayoutNodeKt.requireOwner(LayoutNode.kt:1458)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.placeOuterCoordinator-f8xVGno(LayoutNodeLayoutDelegate.kt:697)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.placeAt-f8xVGno(LayoutNodeLayoutDelegate.kt:681)
at androidx.compose.ui.layout.Placeable.access$placeAt-f8xVGno(Placeable.kt:34)
at androidx.compose.ui.layout.Placeable$PlacementScope.placeWithLayer-aW-9-wM(Placeable.kt:489)
at androidx.compose.ui.layout.Placeable$PlacementScope.placeWithLayer-aW-9-wM$default(Placeable.kt:320)
at androidx.compose.foundation.lazy.LazyListMeasuredItem.place(LazyListMeasuredItem.kt:182)
at androidx.compose.foundation.lazy.LazyListMeasureKt$measureLazyList$8.invoke(LazyListMeasure.kt:352)
at androidx.compose.foundation.lazy.LazyListMeasureKt$measureLazyList$8.invoke(LazyListMeasure.kt:349)
at androidx.compose.ui.layout.MeasureScope$layout$1.placeChildren(MeasureScope.kt:70)
at androidx.compose.foundation.lazy.LazyListMeasureResult.placeChildren(Unknown Source:2)
at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$createMeasurePolicy$1$measure-3p2s80s$$inlined$createMeasureResult$1.placeChildren(SubcomposeLayout.kt:951)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate$layoutChildren$1$1.invoke(LayoutNodeLayoutDelegate.kt:379)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate$layoutChildren$1$1.invoke(LayoutNodeLayoutDelegate.kt:371)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2303)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:473)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:230)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:133)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeLayoutSnapshotReads$ui_release(OwnerSnapshotObserver.kt:83)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.layoutChildren(LayoutNodeLayoutDelegate.kt:371)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.onNodePlaced$ui_release(LayoutNodeLayoutDelegate.kt:515)
at androidx.compose.ui.node.InnerNodeCoordinator.placeAt-f8xVGno(InnerNodeCoordinator.kt:160)
at androidx.compose.ui.layout.Placeable.access$placeAt-f8xVGno(Placeable.kt:34)
at androidx.compose.ui.layout.Placeable$PlacementScope.place(Placeable.kt:460)
at androidx.compose.ui.layout.Placeable$PlacementScope.place$default(Placeable.kt:218)
at androidx.compose.foundation.AndroidOverscrollKt$StretchOverscrollNonClippingLayer$2$1.invoke(AndroidOverscroll.kt:588)
at androidx.compose.foundation.AndroidOverscrollKt$StretchOverscrollNonClippingLayer$2$1.invoke(AndroidOverscroll.kt:587)
at androidx.compose.ui.layout.MeasureScope$layout$1.placeChildren(MeasureScope.kt:70)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.placeAt-f8xVGno(LayoutModifierNodeCoordinator.kt:172)
at androidx.compose.ui.layout.Placeable.access$placeAt-f8xVGno(Placeable.kt:34)
at androidx.compose.ui.layout.Placeable$PlacementScope.placeWithLayer(Placeable.kt:486)
at androidx.compose.ui.layout.Placeable$PlacementScope.placeWithLayer$default(Placeable.kt:299)
at androidx.compose.foundation.AndroidOverscrollKt$StretchOverscrollNonClippingLayer$1$1.invoke(AndroidOverscroll.kt:576)
at androidx.compose.foundation.AndroidOverscrollKt$StretchOverscrollNonClippingLayer$1$1.invoke(AndroidOverscroll.kt:569)
at androidx.compose.ui.layout.MeasureScope$layout$1.placeChildren(MeasureScope.kt:70)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.placeAt-f8xVGno(LayoutModifierNodeCoordinator.kt:172)
14:54:13.754 AndroidRuntime app.symfonik.music.player.debug E at androidx.compose.ui.layout.Placeable.access$placeAt-f8xVGno(Placeable.kt:34)
at androidx.compose.ui.layout.Placeable$PlacementScope.placeWithLayer(Placeable.kt:486)
at androidx.compose.ui.layout.Placeable$PlacementScope.placeWithLayer$default(Placeable.kt:299)
at androidx.compose.ui.graphics.SimpleGraphicsLayerModifier$measure$1.invoke(GraphicsLayerModifier.kt:648)
at androidx.compose.ui.graphics.SimpleGraphicsLayerModifier$measure$1.invoke(GraphicsLayerModifier.kt:647)
at androidx.compose.ui.layout.MeasureScope$layout$1.placeChildren(MeasureScope.kt:70)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.placeAt-f8xVGno(LayoutModifierNodeCoordinator.kt:172)
at androidx.compose.ui.layout.Placeable.access$placeAt-f8xVGno(Placeable.kt:34)
at androidx.compose.ui.layout.Placeable$PlacementScope.place-70tqf50(Placeable.kt:463)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate$placeOuterCoordinator$1.invoke(LayoutNodeLayoutDelegate.kt:709)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate$placeOuterCoordinator$1.invoke(LayoutNodeLayoutDelegate.kt:704)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2303)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:473)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:230)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:133)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeLayoutModifierSnapshotReads$ui_release(OwnerSnapshotObserver.kt:98)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.placeOuterCoordinator-f8xVGno(LayoutNodeLayoutDelegate.kt:704)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.replace(LayoutNodeLayoutDelegate.kt:730)
at androidx.compose.ui.node.LayoutNode.replace$ui_release(LayoutNode.kt:917)
at androidx.compose.ui.node.MeasureAndLayoutDelegate.measureAndLayout-0kLqBqw(MeasureAndLayoutDelegate.kt:426)
at androidx.compose.ui.platform.AndroidComposeView.measureAndLayout-0kLqBqw(AndroidComposeView.android.kt:920)
at androidx.compose.ui.node.LayoutNode.forceRemeasure(LayoutNode.kt:1221)
at androidx.compose.foundation.lazy.LazyListState.snapToItemIndexInternal$foundation_release(LazyListState.kt:271)
at androidx.compose.foundation.lazy.LazyListState$scrollToItem$2.invokeSuspend(LazyListState.kt:263)
at androidx.compose.foundation.lazy.LazyListState$scrollToItem$2.invoke(Unknown Source:8)
at androidx.compose.foundation.lazy.LazyListState$scrollToItem$2.invoke(Unknown Source:4)
at androidx.compose.foundation.gestures.DefaultScrollableState$scroll$2$1.invokeSuspend(ScrollableState.kt:181)
at androidx.compose.foundation.gestures.DefaultScrollableState$scroll$2$1.invoke(Unknown Source:8)
at androidx.compose.foundation.gestures.DefaultScrollableState$scroll$2$1.invoke(Unknown Source:4)
at androidx.compose.foundation.MutatorMutex$mutateWith$2.invokeSuspend(MutatorMutex.kt:173)
at androidx.compose.foundation.MutatorMutex$mutateWith$2.invoke(Unknown Source:8)
at androidx.compose.foundation.MutatorMutex$mutateWith$2.invoke(Unknown Source:4)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:264)
at androidx.compose.foundation.MutatorMutex.mutateWith(MutatorMutex.kt:166)
at androidx.compose.foundation.gestures.DefaultScrollableState$scroll$2.invokeSuspend(ScrollableState.kt:178)
at androidx.compose.foundation.gestures.DefaultScrollableState$scroll$2.invoke(Unknown Source:8)
at androidx.compose.foundation.gestures.DefaultScrollableState$scroll$2.invoke(Unknown Source:4)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:264)
14:54:13.755 AndroidRuntime app.symfonik.music.player.debug E at androidx.compose.foundation.gestures.DefaultScrollableState.scroll(ScrollableState.kt:177)
at androidx.compose.foundation.lazy.LazyListState.scroll(LazyListState.kt:287)
at androidx.compose.foundation.gestures.ScrollableState.scroll$default(ScrollableState.kt:53)
at androidx.compose.foundation.lazy.LazyListState.scrollToItem(LazyListState.kt:262)
at app.symfonik.core.ui.common.lazylist.LazyColumnScrollbarKt$LazyColumnScrollbar$setScrollOffset$1.invokeSuspend(LazyColumnScrollbar.kt:164)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch(AndroidUiDispatcher.android.kt:81)
at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch(AndroidUiDispatcher.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:68)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1229)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239)
at android.view.Choreographer.doCallbacks(Choreographer.java:899)
at android.view.Choreographer.doFrame(Choreographer.java:827)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7918)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@379b64b, androidx.compose.runtime.BroadcastFrameClock@95fa828, StandaloneCoroutine{Cancelling}@9e6f941, AndroidUiDispatcher@901ee6]
And for my case, this is an 1.6 A3 issue, reverting to 1.6 A2 (And M3 to 1.2 A4) does fix this at 100%
mn...@google.com <mn...@google.com> #7
I just quickly tested latest SNAPSHOT (10683443) and now the error is different and requires a lot more scrolls to trigger.
Thanks for verifying. The snapshot above contains our fix for placement that affected lookahead. Given that the issue is a lot more difficult to trigger, it's likely the result of the fix. The new stacktrace seems like a different issue.
Andrey, could you take a look at the stacktrace in
ut...@gmail.com <ut...@gmail.com> #8
The original stacktrace which has "forceMeasureTheSubtree" in it is the one fixed by aosp/2698053 which should be a part of the next alpha. However the new one "LayoutNode should be attached to an owner" is something new and I don't have immediate ideas what it can be related to. We will need a way to reproduce it, maybe you can try to come up with a sample project?
ed...@gmail.com <ed...@gmail.com> #9
Since it will still crash in A4 for my app, I'm reverting to A2 and a little out of delay so lack time this week to try to extract a repro that will probably be complicated as only crashing in a specific screen.
I can still add some logs / test things if you have idea to gain time on this. (Like what I could remove from that screen to pinpoint,...)
Description
Jetpack Compose component used:`semantics`
Android Studio Build:Android Studio Flamingo | 2022.2.1 Patch 2
Kotlin version: 1.8.21
Thank you so much for the travesalIndex/traversalGroup release! It has mostly worked as expected. The one issue I am seeing is when the parent has semantics(mergeDescendants = true) {}. I made an example:
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
TraveralTestTheme {
TraversalExample(
modifier = Modifier
.semantics(mergeDescendants = true) { }
.background(color = Color.Gray)
.fillMaxSize()
)
}
}
}
}
@Composable
fun TraversalExample(
modifier: Modifier = Modifier,
) {
Row(
horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically,
modifier = modifier.semantics { isTraversalGroup = true },
){
Column {
Text(
text = "I should be announced first",
modifier = Modifier
.padding(16.dp)
.semantics { traversalIndex = 1f },
)
Text(
text = "I should be announced third",
modifier = Modifier
.padding(16.dp)
.semantics { traversalIndex = 3f },
)
}
Text(
text = "I should be announced second",
modifier = Modifier
.padding(16.dp)
.semantics { traversalIndex = 2f },
)
}
}
The announcement order is: 1,3,2.
The announced string is: "I should be announced first, I should be announced third, I should be announced second"