使用apt来导入butterknife和dagger的时候,会报警告 (在引用databinding的时候会报,其他不会)
Warning:Using incompatible plugins for the annotation processing: android-apt. This may result in an unexpected behavior.
解决方案:
1、apt 'com.jakewharton:butterknife-compiler:8.2.1' 改为=》annotationProcessor 'com.jakewharton:butterknife-compiler:8.2.1'
2、删除:project build.gradle 中的
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' 添加apt的操作
3、删除 app build.gradle 中的:
apply plugin: 'com.neenbedankt.android-apt'
总的来说只需在app/grade中添加两句就可以了
compile 'com.jakewharton:butterknife:8.2.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.2.1'
不过按之前那种方式也可以,运行也不会报错,看个人而言。。。
點擊查看更多內容
為 TA 點贊
評論
評論
共同學習,寫下你的評論
評論加載中...
作者其他優質文章
正在加載中
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦