Clément Jean
05/24/2021, 10:08 AMui_components
(android library)
/**
* Display a vertical list of [OutlinedTextField]
*/
@Composable
fun Form(fields: List<FormField>) {
LazyColumn(content = {
items(fields) { item ->
OutlinedTextField(
value = item.mutableState.value,
onValueChange = { item.mutableState.value = it },
label = { Text(text = stringResource(id = item.label)) },
isError = item.isError(item.mutableState.value)
)
}
})
}
However, when I compile the logs show me the following error:
e: org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Couldn't inline method call 'items' into
local final fun androidx.compose.foundation.lazy.LazyListScope.<anonymous>(): kotlin.Unit defined in com.xxx.xxx.ui_components.Form
{
items(fields) { item ->
OutlinedTextField(
value = item.mutableState.value,
onValueChange = { item.mutableState.value = it },
label = { Text(text = stringResource(id = item.label)) },
isError = item.isError(item.mutableState.value)
)
}
}
Am I doing something wrong here? Because individually the module compile (so no dependency missing, I guess) and without the dependency to ui_components
the app compiles.
Would be great if you can explain me, thanks in advance! 🙏okarm
05/24/2021, 11:44 AM