您的位置:首页 > 其它

坑爹的ANDRODI STUDIO升级2.3之后导致databinding报错

2017-03-14 19:07 190 查看
升级studio之后遇到


android
error: package *.*.databinding 不存在这样的错误,坑爹的找了两天。


一直以为是哪个布局文件写法有问题,恨不得七八十个页面一个一个的排查。一直忽略了这个黄色警告

Using incompatible plugins for the annotation processing: android-apt. This may result in an unexpected behavior.

最后google到了下面这段话

Your app level gradle dependencies should include (as per butterknife website instructions):
compile 'com.jakewharton:butterknife:8.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'


You can remove the line : 
apply plugin: 'com.neenbedankt.android-apt'


Annotation Processing became available in Android Gradle plugin (2.2 and later) so there is now no need to use the above plugin anymore if using this version of gradle or greater.

If you'd like to know how to turn annotation processing off and on and AS the setting is in : 

Settings > Build, Execution, Deployment > Compiler > Annotation Processors

这样该国之后一切ok。只想说,有时候黄色的警告!我们确实不能忽略啊
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: