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

本文介绍了如何解决升级Android Studio后出现的包不存在错误,并详细解释了如何调整Gradle配置及禁用不兼容插件来避免此类问题。
升级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。只想说,有时候黄色的警告!我们确实不能忽略啊







评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值