Import ButterKnife into the project to facilitate the binding of View, so gradle is configured as follows:
implementation 'com.jakewharton:butterknife:10.2.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.0'
The guide package started to be used, but the following error was reported:
CompilationFailedException
So Baidu later added the following configuration to gradle: Added
to defaultConfig in android
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath = true
}
}
join under android
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}