Michal Srutek
02/02/2025, 9:10 AMFatal Exception: kotlin.IllegalStateException
Cannot attach layer if the view is not in the window hierarchy
which seems to be popping up in ComposeHostingViewController
when presenting a Dialog
. We haven't been able to reproduce this yet.
Any ideas of what might be causing this, or how to mitigate the issue?
Stack trace in the thread 🧵 >>>
Thanks!Michal Srutek
02/02/2025, 9:11 AMFatal Exception: kotlin.IllegalStateException
0 OURAPP 0xfffd70 kfun:androidx.compose.ui.scene.ComposeHostingViewController.object-1.createPlatformLayer#internal + 132 (Preconditions.kt:132)
1 OURAPP 0xf9cea4 kfun:androidx.compose.ui.scene.PlatformLayersComposeSceneImpl.createLayer#internal + 190 (PlatformLayersComposeScene.skiko.kt:190)
2 OURAPP 0xf96e04 kfun:androidx.compose.ui.scene#rememberComposeSceneLayer(kotlin.Boolean;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}androidx.compose.ui.scene.ComposeSceneLayer + 263 (ComposeScene.skiko.kt:263)
3 OURAPP 0xfab49c kfun:androidx.compose.ui.window.DialogLayout#internal + 196 (Dialog.skiko.kt:196)
4 OURAPP 0xfa9d80 kfun:androidx.compose.ui.window#Dialog(kotlin.Function0<kotlin.Unit>;androidx.compose.ui.window.DialogProperties?;kotlin.Function2<androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){} + 176 (Dialog.skiko.kt:176)
5 OURAPP 0x1b871a4 kfun:com.ourapp.shared.core.ui.views#OurAppAlertDialog(kotlin.Function0<kotlin.Unit>;com.ourapp.shared.core.ui.views.OurAppDialogButtonConfig?;com.ourapp.shared.core.utils.IconSource?;kotlin.String?;kotlin.String?;androidx.compose.ui.graphics.Color?;androidx.compose.ui.text.TextStyle?;kotlin.String?;com.ourapp.shared.core.ui.views.OurAppDialogButtonConfig?;kotlin.Boolean;androidx.compose.ui.window.DialogProperties?;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int;kotlin.Int){} + 61 (OurAppAlertDialog.kt:61)
Michal Srutek
02/02/2025, 9:12 AMOurAppAlertDialog.kt:61
is just a call which creates a Dialog
Dialog(
onDismissRequest = onDismissRequest,
properties = properties,
) {
...
}
Andrei Salavei
02/03/2025, 1:37 PMAndrei Salavei
02/03/2025, 1:40 PMMichal Srutek
02/03/2025, 3:07 PMAndrei Salavei
02/03/2025, 3:13 PMAndrei Salavei
02/03/2025, 3:16 PMMichal Srutek
02/03/2025, 6:36 PM