我正在尝试将Compose添加到我的项目中,但遇到了以下问题:
org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering
File being compiled: /Users/admin/app/src/main/java/ro/.../DeviceInputFragment.kt
The root cause java.lang.AssertionError was thrown at: org.jetbrains.kotlin.backend.common.ir.IrUtilsKt.copyValueParametersToStatic(IrUtils.kt:264)....
我有以下配置:
目标和编译sdk设置为32
composeOptions { kotlinCompilerExtensionVersion "1.1.1" }
kotlinVersion = '1.6.10'
classpath 'com.android.tools.build:gradle:7.0.4'
kotlinOptions { jvmTarget = "1.8" useIR = true }
buildFeatures { compose = true }
也许您可以提供一些建议。composeVersion = "1.1.1"
implementation "androidx.compose.runtime:runtime:$composeVersion" implementation "androidx.compose.ui:ui:$composeVersion" implementation "androidx.compose.foundation:foundation:$composeVersion" implementation "androidx.compose.foundation:foundation-layout:$composeVersion" implementation "androidx.compose.material:material:$composeVersion" implementation "androidx.compose.runtime:runtime-livedata:$composeVersion" implementation "androidx.compose.ui:ui-tooling:$composeVersion"