Search code examples
android-gradle-pluginbutterknifeandroid-lint

Android lint AnnotationProcessorOnCompilePath with ButterKnife


After upgrading to latest Android gradle plugin:

classpath 'com.android.tools.build:gradle:3.6.1'

Android lint (./gradlew lint) getting following warning:

Warning: Add annotation processor to processor path using annotationProcessor instead of implementation [AnnotationProcessorOnCompilePath] implementation 'com.jakewharton:butterknife:10.2.1'

My app/build.gradle file:

dependencies {
  [...]
  implementation 'com.jakewharton:butterknife:10.2.1'
  kapt 'com.jakewharton:butterknife-compiler:10.2.1'
}

Which is correct according to ButterKnife documentation: https://github.com/JakeWharton/butterknife#download

Hacky solution would be to suppress //noinspection AnnotationProcessorOnCompilePath for ButterKnife.

But how to fix this problem properly?


Solution

  • Apparently, it's a bug on Lint side. They say it will be fixed on the upcoming 4.0 release.

    Source: https://issuetracker.google.com/issues/140881211