user842225
user842225

Reputation: 5989

Butterknife+kotlin: Incremental annotation processing requested, but support is disabled because the following processors are not incremental

I am developing an Android project in Kotlin.

My Gradle version 3.5.3

In my app module build.gradle I added Butterknife dependency:

implementation "com.jakewharton:butterknife:10.1.0"
annotationProcessor "com.jakewharton:butterknife-compiler:10.1.0"
kapt "com.jakewharton:butterknife-compiler:10.1.0"

But I get kotlin compiler warning:

enter image description here

w: [kapt] Incremental annotation processing requested, but support is disabled because the following processors are not incremental: butterknife.compiler.ButterKnifeProcessor (NON_INCREMENTAL).

In my app build.gradle file I have:

  android {
    ...
    compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
  }

Why is above warning? How can I solve it?

(I also tried adding kapt.incremental.apt=true in gradle.peroperties. It doesn't help.)

Upvotes: 1

Views: 2714

Answers (3)

HMI
HMI

Reputation: 41

download JDK11 and add this line to your bash profile.

export JAVA_HOME = /users/JDK11/Contents/Home

JDK11 is the folder where your newly downloaded JDK is

Upvotes: 0

Stanislav Shamilov
Stanislav Shamilov

Reputation: 1826

Incremental annotation processing must be supported by an annotation processor itself, so you can't do much with the warning. You can try looking into the processor's repository and ask its maintainers about the ETA of incremental annotation processing support.

Update: I've just noticed that butterknife supports incremental processing, so the issue isn't related to the library. The other assumption that there is a problem with kapt. This article might be helpful for you: https://medium.com/@daniel_novak/making-incremental-kapt-work-speed-up-your-kotlin-projects-539db1a771cf

Upvotes: 1

Edgar
Edgar

Reputation: 1

 compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

add this to below android in app.gradle file

Upvotes: 0

Related Questions