Fatal Exception: f0.h: Compose Runtime internal error. Unexpected or incorrect use of the Compose internal runtime API (Missed recording an endGroup). Please report to Google or use https://goo.gle/compose-feedback
at androidx.compose.runtime.ComposerKt.composeRuntimeError(Composer.kt:15)
at androidx.compose.runtime.ComposerImpl.recordEndGroup(ComposerImpl.java:889)
at androidx.compose.runtime.ComposerImpl.end(ComposerImpl.java:889)
at androidx.compose.runtime.ComposerImpl.endGroup(ComposerImpl.java:1)
at androidx.compose.runtime.ComposerImpl.endRoot(ComposerImpl.java:1)
at androidx.compose.runtime.ComposerImpl.doCompose(ComposerImpl.java:130)
at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(ComposerImpl.java:35)
...
코드의 depth가 깊어지면 복잡해지므로, depth를 최소화하기 위해 사용하는 방법
@Composable
fun ContentLoading(isLoading: Boolean) {
Box(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.Center
) {
if (isLoading) {
CircularProgressIndicator(
modifier = Modifier.wrapContentSize()
)
}
}
}
위 코드에 early return을 적용하면 depth를 줄일 수 있음
@Composable
fun ContentLoading(isLoading: Boolean) {
Box(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.Center
) {
if (isLoading.not()) return
CircularProgressIndicator(
modifier = Modifier.wrapContentSize()
)
}
}
Fix ability to return early from inline composable functions (b/255350755)
내부 앱 공유
기능을 활용하여 테스트 진행1.4
버전, 아래 앱은 Compose Compiler 1.3
버전 사용Compose Ver | Compiler Ver | Crash 여부 |
---|---|---|
1.4.0-alpha01 | 1.4.0-alpha01 | X |
1.3.3 | 1.3.2 | O |