在使用dataBinding时,Android Studio出现警告Warning:Using incompatible plugins for the annotation processing: android-apt. This may result in an unexpected behavior.
然后编译文件时,报错databinding不存在
上网stackoverflow在查了资料,
发现插件butterknife会与dataBinding冲突,需要更改设置
compile ‘com.jakewharton:butterknife:8.8.1’
apt ‘com.jakewharton:butterknife-compiler:8.8.1’
更改为
compile ‘com.jakewharton:butterknife:8.8.1’
annotationProcessor ‘com.jakewharton:butterknife-compiler:8.8.1’
并且移除apply plugin: ‘android-apt’ 和 classpath ‘com.neenbedankt.gradle.plugins:android-apt:1.8’
之后再编译就成功了