ERROR: The Android Gradle plugin supports only Butterknife Gradle plugin version 9.0.0-rc2 and higher

Viewed 7205

I am update android studio to 3.3, in my project I get this error:

ERROR: The Android Gradle plugin supports only Butterknife Gradle plugin version 9.0.0-rc2 and higher.
The following dependencies do not satisfy the required version:
root project 'MyProject' -> com.jakewharton:butterknife-gradle-plugin:8.8.1
Affected Modules: app

and I am ready update Butterknife to 9.0.0-rc2

implementation 'com.jakewharton:butterknife:9.0.0-rc2'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc2'
3 Answers

Are you using androidx in your app/library? If so, I would bump the butterknife version to the stable 10.0.0 version, otherwise update to the stable 9.0.0 one.

Without androidx:

implementation 'com.jakewharton:butterknife:9.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0'

With androidx:

implementation 'com.jakewharton:butterknife:10.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'

You can find more about it in the change log here.

You need to update the Butter Knife plugin inside your project build.gradle to something like this:

buildscript {
  repositories {
    mavenCentral()
   }
  dependencies {
    classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-rc2'
  }
}

I have the same problem here. The way to fix this is to update in the build.grandle(Project) with this:

dependencies {
    classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-rc2'
}

and in the build.grandle(App) with this:

dependencies {
    implementation 'com.jakewharton:butterknife:9.0.0-rc2'
    annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc2'
}

Keep in mind that in this version the @InjectView is replace with @BindView.

Related