Yann Badoual
11/14/2020, 8:02 PMjava.lang.IllegalStateException: Start/end imbalance
when using them
Wrapping the whole follow code into a conditional block instead fixes the issueromainguy
11/14/2020, 8:10 PMLeland Richardson [G]
11/14/2020, 8:16 PMYann Badoual
11/14/2020, 8:43 PMArchie
11/17/2020, 9:33 AM@Composable
fun MyComposable(
myStateList: List<MyState>,
...,
) {
// ------- This here is causing the error
val transformedMyState = myStateList.map {
myTransformation(it)
}
// ------- Removing the code above, also removes the error
LazyRowForIndexed(transformedMyState) {
...
}
}
It was perfectly working on alpha06
and only encountered the error after migrating to alpha07
. So in the end I settled to:
@Composable
fun MyComposable(
myStateList: List<MyState>,
...,
) {
LazyRowForIndexed(
myStateList.map {
myTransformation(it)
}
) {
...
}
}
I then no longer get the error... 🤔Leland Richardson [G]
11/18/2020, 12:10 AMArchie
11/18/2020, 3:57 AMLeland Richardson [G]
11/18/2020, 3:58 AMArchie
11/18/2020, 1:11 PMYann Badoual
11/19/2020, 2:10 PM@Composable
fun BuggedComposable(
) {
Surface {
Box(modifier = Modifier.fillMaxSize()) {
val state = mutableStateOf<String?>(null)
val title = state.value ?: return@Box
}
}
}
Removing the ?: return@Box
fixes the crash.
Do you want me to file a bug with this?
(Using alpha07 and kotlin 1.4.0)Leland Richardson [G]
11/19/2020, 5:59 PMYann Badoual
11/19/2020, 6:11 PMLeland Richardson [G]
11/19/2020, 6:23 PMYann Badoual
12/21/2020, 6:49 PMPaul Woitaschek
01/24/2023, 4:48 PM