我正在Surface中创建一个自定义Checkbox,它有一个Modifier.clickable:

    Surface(
        modifier = Modifier
            .clickable(
                enabled = enabled,
                interactionSource = interactionSource,
                indication = rememberRipple(),
                role = Role.Checkbox,
                onClick = { onCheckedChange(!checked) }
            )
            .then(modifier),
    ) {
        Row {
            Checkbox(checked = checked, onCheckedChange = {}, colors = colors)
            Text(text = text ?: "")
        }
    }

When I try to build that, I get the Exception during IR lowering error error:

org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering
File being compiled: /home/rene/AndroidStudioProjects/pass13/app/src/main/java/com/aresid/simplepasswordgeneratorapp/ui/widgets/Checkbox.kt

请参阅完整的stacktrace here.

移除Modifier.clickable可以解决构建问题.

I already tried up-/downgrading some versions but nothing is working properly.
Currently, I am using those versions:

    ext.versions = [
            'compileSdk': 31,
            'targetSdk' : 30,
            'minSdk'    : 26,
            'kotlin'    : '1.5.30',
            'navigation': '2.3.5',
            'compose'   : '1.0.2'
    ]

Has anybody an idea how to fix that?

推荐答案

因此,我按照@PhilipDukhov的建议,通过JetBrains团队的问题跟踪程序与他们联系,他们解决了我的问题:https://youtrack.jetbrains.com/issue/KT-48815.

I was using kotlinCompilerExtensionVersion = versions.composeVersion in my app's build.gradle file and this is incorrect. versions.composeVersion is something provided by Gradle but it seems to be deprecated. Oneself should manually write the version which they're using there.

Kotlin相关问答推荐

我需要后台工作才能使用卡夫卡的消息吗?

用Quarkus和Reactor重写异步过滤器中的数据流

如何让 LocalDateTime.parse 拒绝 24:00 时间

根据字符串值动态过滤数组列表 - kotlin

为什么多线程不会使执行更快

Kotlin 中私有集的完整语法 struct 是什么?

is return inside function definition 也是 kotlin 中的表达式

使用纯 Kotlin 函数作为 Junit5 方法源

如何使用 Android CameraX 自动对焦

JobIntentService 被销毁,当应用程序被销毁时

Android 在将 androidx 生物识别更新为 1.0.0-alpha04 后崩溃

在协程中等待侦听器内的数据

Firebase 权限被拒绝

Kotlin解构when/if语句

RecyclerView SnapHelper无法显示第一个/最后一个元素

Kotlin中的Memoization功能

kotlin 委托有什么用?

IllegalStateException:function = , count = 3, index = 3

uses-sdk:minSdkVersion 16 不能小于库中声明的版本 23

将字符串编码为Kotlin中的UTF-8