I’m getting bunch of weird looking crashes when I use
ComposeView
within my application. I’ve dug trough all the sources and still cannot find the cause od the problem. TLDR version of it is that I have a list with error view on top of it that contains “refresh” button. Clicking it with my internet off (so that the view will appear) makes my app crash with bunch of compose related logs that do not point in any direction such as:
java.lang.ArrayIndexOutOfBoundsException: length=3; index=3 -> ViewGroup
java.lang.IllegalArgumentException: Failed requirement -> androidx.compose.ui.node.MeasureAndLayoutDelegate
java.lang.IllegalArgumentException: Failed requirement -> androidx.compose.ui.platform.AndroidComposeView.notifyLayerIsDirty
java.lang.IllegalStateException: Underflow in restore - more restores than saves
Exception Type: Unknown (SIGSEGV)
What is important to mention is that it only happens on RELEASE version of the App.
I’ve dissected my app and trying to reproduce the issue on fresh repo but I wasn’t able to, yet.
No such problems when I switch to
ComponentActivity
instead of
Fragment
with
ComposeView
as its only view.
I don’t have unusual amount of recompositions either - around 2 for state.
Would appreciate any kind of help, guidance, ideas what might be the source of my problem.