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

android studio 3.0 di 注入插件引入错误

2018-01-03 15:49 246 查看
apt插件问题(Error:Cannot choose between the following configurations of project :library:)

报错:

Error:Cannot choose between the following configurations of project :library:

- debugApiElements

- debugRuntimeElements

- releaseApiElements

- releaseRuntimeElements

  All of them match the consumer attributes:

解决

//1.在project的build.gradle中删除

classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

//2.在module的build.gradle中删除

apply plugin: 'android-apt'

//3.将module的build.gradle文件中的dependency

apt 'com.jakewharton:butterknife-compiler:8.1.0'

//改为

annotationProcessor 'com.jakewharton:butterknife-compiler:8.1.0'

其他使用apt的依赖,也要这样更改

如果改动不可以,升级gradle版本到4.3  tool 版本升级到3.0.0+
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: