https://kotlinlang.org logo
#compose
Title
# compose
k

kluck

11/23/2020, 9:23 AM
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) :
Copy code
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 :
Copy code
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
d

Dmytro Bazunov

12/04/2020, 8:11 PM
Hi was you able to find solution?
k

kluck

12/07/2020, 11:02 AM
No, I was not… I'll try again with the newest version of compose, I might get lucky
d

Dmytro Bazunov

12/10/2020, 9:19 AM
@kluck Do you have kotlin-dsl plugin in project that have this issue?
6 Views