您的位置:首页 > 移动开发 > Android开发

解决Studio3.0 Dagger2注入Error:android-apt plugin不兼容的问题

2017-11-09 11:07 507 查看
今天在导入Google官方推荐Dagger2注入框架时出现一个错误:

Error:android-apt plugin is incompatible with the Android Gradle plugin.  Please use 'annotationProcessor' configuration instead.

经过查找发现,在Studio升级到3.0之后原来的配置方式apt与最新版本Gradle已经不兼容,推荐使用annotationProcessor,最终的解决办法是:

一、把project目录下的build.gradle中的classpath ‘com.neenbedankt.gradle.plugins:android-apt:1.8'删除掉;

二、把具体Module目录下的build.gradle中的apply plugin: ‘com.neenbedankt.android-apt’删除;

三、同时把dependencies中原来使用apt的改为annotationProcessor,然后Sync
Now即可。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐