Android studio 3.0升级 3.1 之后报错
Data Binding annotation processor version needs to match the Android Gradle Plugin version. You can remove the kapt dependency com.android.databinding:compiler:3.0.1 and Android Gradle Plugin will inject the right version.
所以把 kapt "com.android.databinding:compiler:3.0.1"
删掉就好了,配置databinding正确如下
apply plugin: 'kotlin-kapt'
android {
defaultConfig {
dataBinding {
enabled = true
}
}
}