Butterknife: Unable to find method 'com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List

Created on 20 Jul 2018  Â·  4Comments  Â·  Source: JakeWharton/butterknife

I got an error when I add the line "apply plugin: 'com.jakewharton.butterknife'" in my gradle file.But when I changed the version to 8.5.1 it worked well.
the error as below:
Unable to find method 'com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;'.
Possible causes for this unexpected error include:

  • Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
    Re-download dependencies and sync project (requires network)
  • The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
    Stop Gradle build processes (requires restart)
  • Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

Most helpful comment

@JinJieGu

添加仓库 maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
\===================================================
add maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }

All 4 comments

This has already been fixed on master. You can use the 9.0.0-SNAPSHOT version if you need the latest features and functionality of the library with AGP 3.1 or newer.

Ok,Thank you very much!

@JakeWharton 9.0.0-SNAPSHOT not found. how to use it? Can you give a demo?

@JinJieGu

添加仓库 maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
\===================================================
add maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }

Was this page helpful?
0 / 5 - 0 ratings