I’m encountering a compilation error while trying to build a custom checkable component in Jetpack Compose. This issue arises when I include a clickable modifier in my implementation.
Here’s the code I used:
Surface(
modifier = Modifier
.clickable(
enabled = isEnabled,
interactionSource = touchSource,
indication = rememberRipple(),
role = Role.Checkbox,
onClick = { onToggleChange(!isToggled) }
)
.then(customModifier),
) {
Row {
Checkbox(checked = isToggled, onCheckedChange = {}, colors = checkboxColors)
Text(text = labelText ?: "")
}
}
The build process fails and shows this error:
org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering
File being compiled: /path/to/project/ui/components/CustomCheckbox.kt
Everything compiles without the clickable modifier. I’ve also experimented with various version setups, but nothing resolves the issue.
Here are my current configuration details:
ext.versions = [
'compileSdk': 31,
'targetSdk' : 30,
'minSdk' : 26,
'kotlin' : '1.5.30',
'navigation': '2.3.5',
'compose' : '1.0.2'
]
Does anyone have any ideas on how to fix this compilation error?