1. 报错提示:Error:android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationProcessor' configuration instead.
2. 报错原因:经过查找发现,在Studio升级到3.0之后原来的配置方式apt与最新版本Gradle已经不兼容,推荐使用annotationProcessor,
3.解决报错:
一、把project目录下的build.gradle中如果有添加配置:请classpath ‘com.neenbedankt.gradle.plugins:android-apt:1.8'删除掉;
二、把具体Module目录下的build.gradle中如果有添加配置:请apply plugin: ‘com.neenbedankt.android-apt’删除;
三、同时把dependencies中原来使用apt
implementation 'com.google.dagger:dagger:2.16' apt 'com.google.dagger:dagger-compiler:2.16'
改为annotationProcessor
implementation 'com.google.dagger:dagger:2.16' annotationProcessor 'com.google.dagger:dagger-compiler:2.16'然后Sync Now即可。原博主链接: 点击打开链接