Android studio 3.0:编译应用程序时出错

Android studio 3.0:编译应用程序时出错,android,android-gradle-plugin,butterknife,android-studio-3.0,Android,Android Gradle Plugin,Butterknife,Android Studio 3.0,编译android应用程序时出错 Execution failed for task ':app:javaPreCompileDebug' The following dependencies on the compile classpath are found to contain annotation processor.Please add them to the annotationProcessor configuration. - butterknife-5.1.2.jar (but

编译android应用程序时出错

Execution failed for task ':app:javaPreCompileDebug'
The following dependencies on the compile classpath are found to contain annotation processor.Please add them to the annotationProcessor configuration.
- butterknife-5.1.2.jar (butterknife-5.1.2.jar)

尝试添加此库的最新版本。不要忘记在依赖项中添加annotationProcessor:

compile 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

不要使用5.1.2 jar,而是在gradle中使用这个最新版本,并使用注释使其工作

dependencies {
    compile 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}

在应用程序gradle中添加以下行

 compile 'com.jakewharton:butterknife:8.8.1'
 annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
然后在类中使用BindView而不是Bind