---project的 build.gradle中
1:在repositories 中添加
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
2:在dependencies 中添加
classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT'
3:在allprojects 的 repositories 中添加:
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
---Module的 build.gradle中
1:在根目录最外层添加:
apply plugin:'com.jakewharton.butterknife'
2:在android 下 defaultConfig 中添加:
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath = true
}
}
3:在dependencies 中添加:
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
以上2项不生效,请选择添加以下3项:(以此3项为主)
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.jakewharton:butterknife-annotations:8.8.1'
编译一次,本地就有了对应的版本,即使在改回第一种依赖配置,也可以的。