butterknife遇到Error:android-apt plugin is incompatible with the Android Gradle plugin问题

使用butterknife的时候出现了这个错误

Error:android-apt plugin is incompatible with the Android Gradle plugin.  Please use 'annotationProcessor' configuration instead.

解决方法
1.在项目的build.gradle中删除

classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

2.在module的build.gradle中删除

apply plugin: 'com.neenbedankt.android-apt' 

3.在module的dependencies中修改

 //implementation 'com.jakewharton:butterknife:10.1.0'
 annotationProcessor 'com.jakewharton:butterknife:10.1.0'
 annotationProcessor "com.jakewharton:butterknife-compiler:10.1.0"

你可能感兴趣的:(butterknife遇到Error:android-apt plugin is incompatible with the Android Gradle plugin问题)