https://kotlinlang.org logo
Title
a

Anmol Verma

04/27/2023, 11:47 AM
Hi Folks, I have been building a slack clone with compose multiplatform with gRPC, I am facing an issue with compose UI crashing only on iOS with the following error :
Uncaught Kotlin exception: kotlin.IllegalStateException: LayoutCoordinate operations are only valid when isAttached is true
I am on latest version of compose jetbrains, Has anyone faced this before ?
Here's a video of the crash 😒ad-panda:
p

Pablichjenkov

04/27/2023, 12:19 PM
I haven't seen it, sounds interesting what the message says. I would recommend opening an issue in the GitHub repo if you don't get a response here
a

Anmol Verma

04/27/2023, 12:40 PM
Found a similar issue here and someone faced this on
1.3.1
too 🤔
same with Desktop and Android too 🤔
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: LayoutCoordinate operations are only valid when isAttached is true
	at androidx.compose.ui.node.NodeCoordinator.localToRoot-MK-Hz9U(NodeCoordinator.kt:885)
	at androidx.compose.foundation.text.TextFieldDelegate$Companion.notifyFocusedRect$foundation(TextFieldDelegate.kt:173)
	at androidx.compose.foundation.text.CoreTextFieldKt.notifyFocusedRect(CoreTextField.kt:1088)
	at androidx.compose.foundation.text.CoreTextFieldKt.access$notifyFocusedRect(CoreTextField.kt:1)
	at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5$1$1$2.measure-3p2s80s(CoreTextField.kt:621)
	at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(InnerNodeCoordinator.kt:103)
	at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasure$2.invoke(LayoutNodeLayoutDelegate.kt:1090)
	at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasure$2.invoke(LayoutNodeLayoutDelegate.kt:1086)
	at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2201)
	at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:238)
	at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:234)
	at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
	at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source)
	at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:234)
	at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui(OwnerSnapshotObserver.kt:120)
	at androidx.compose.ui.node.OwnerSnapshotObserver.observeMeasureSnapshotReads$ui(OwnerSnapshotObserver.kt:107)
	at androidx.compose.ui.node.LayoutNodeLayoutDelegate.performMeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:1086)
	at androidx.compose.ui.node.LayoutNodeLayoutDelegate.access$performMeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:36)
	at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.remeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:34
d

Dima Avdeev

04/27/2023, 12:46 PM
Hello! Thanks for bug description. The best way is to create a minimal reproducible sample of this crash. It means reproducing the bug with minimal amount of code. Click one button to reproduce. Can you please do so and share in on GitHub?