I'm having trouble setting up compose on an existing project. I'm using gradle 6.7.1, kotlin 1.4.10 and compose 1.0.0-alpha07. In my app build.gradle.kts file, I have (simplified) :
buildFeatures {
compose = true
}
kotlinOptions {
jvmTarget = "1.8"
useIR = true
}
composeOptions {
kotlinCompilerVersion = versions.kotlin
kotlinCompilerExtensionVersion = versions.compose
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
dependencies {
implementation(libs.compose.ui)
implementation(libs.compose.tooling)
implementation(libs.compose.foundation)
implementation(libs.compose.material)
}
When I try to build, I get an error :
Caused by: org.gradle.internal.event.ListenerNotificationException: Failed to notify project evaluation listener.
Caused by: java.lang.NoClassDefFoundError: org/jetbrains/kotlin/gradle/tasks/KotlinCompile
Could it be related to the fact I'm using a .kts build file? -> Doesn't seem to be the case, I just created a Template Compose app, and migrated it to a build.gradle.kts: it works fine