butterknife环境配置:
1、依赖注入:app/moudle下添加依赖
//butterknife 依赖
implementation ‘com.jakewharton:butterknife:10.0.0’
annotationProcessor ‘com.jakewharton:butterknife-compiler:10.0.0’
2、错误:Static interface methods are only supported starting with Android N (–min-api 24): void butterknife.Unbinder.lambda$static$0()
需指定jdk版本:
android {
…
defaultConfig {
…
//指定jdk版本
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
…
}
…
}
3、butterknife运用:
运用嘛,还是LayoutCreator更香;