Butterknife:
1.使用前首先是在项目的Project的build.gradle的dependencies{ }中加入一句话:
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
//Butterknife
classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
2.在当前项目app的build.gradle中引入依赖如下:
//ButterKnife
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'