Thread
#multiplatform
    m

    Maurice Jouvet

    2 years ago
    How can I add annotationProcessor on my build.gradle.kts (DSL)? (I’m on Android part here) I need that:
    kapt("androidx.lifecycle:lifecycle-compiler:$lifecycleVersion")
    But with my configuration it’s not working, can’t find the solution.. It says, required KaptOption.. Here is what I have:
    sourceSets {
        val androidMain by getting {
            kotlin.srcDir("src/main/kotlin")
            dependencies {
                kapt("androidx.lifecycle:lifecycle-compiler:$lifecycleVersion")
    Kris Wong

    Kris Wong

    2 years ago
    m

    Maurice Jouvet

    2 years ago
    Hum, not working for me, the same thing.. Type mismatch: inferred type is String but Action<KaptExtension> was expected
    I did exactly the same configuration:
    dependencies {
        kapt("androidx.lifecycle:lifecycle-compiler:$lifecycleVersion")
    }
    I am using the latest version of gradle. 6.1.
    I found this: https://github.com/gradle/kotlin-dsl-samples/issues/1372 But not working as well..
    Kris Wong

    Kris Wong

    2 years ago
    what if you try it within
    android.dependencies
    ?
    m

    Maurice Jouvet

    2 years ago
    How can I do that?
    Ok I found.
    Ah! It passed in android!!! I am building right now, hope it’s going to work. Thank you very much!!!!
    Kris Wong

    Kris Wong

    2 years ago
    🙌
    m

    Maurice Jouvet

    2 years ago
    Damn still the same issue:
    Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor.
    I’ll try something else, thank you very much anyway.
    I’m stuck..
    Kris Wong

    Kris Wong

    2 years ago
    sounds like progress
    m

    Maurice Jouvet

    2 years ago
    I have some progress now, I have this error: Project with path ‘androidx.lifecycle:lifecycle-compiler:2.2.0-rc03’ could not be found in project ‘:android’.
    Kris Wong

    Kris Wong

    2 years ago
    that's an odd one
    m

    Maurice Jouvet

    2 years ago
    Ok by changing kapt(project()) by kapt(compileOnly()) it passed. But I have now the original issue: Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to