Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compose beta01 - java.lang.IllegalStateException: Attempted to realize group twice

I am migrating to Jetpack Compose 1.0.0-beta01 and I am encountering a compiler crash. java.lang.IllegalStateException: Attempted to realize group twice the logs are pretty obscure and nothing seems to point the our code. Has anyone encountered something similar or has an idea how I could find the source of this issue?

like image 859
sachadso Avatar asked Mar 01 '21 14:03

sachadso


1 Answers

I have this issue when compile a code with @Composable function in forEach lambda of collection of Any elements. Something like this

listOf(1f, 2.0, 4L, 0).forEach {
    Text("value: $it")
}

So check your code for this bottleneck.

like image 188
Constantin Avatar answered Jan 04 '23 08:01

Constantin