Android Studio升級3.0,打開以前的老項目后又給我?guī)砹艘簧窨?如圖:
Error:Cannot choose between the following configurations of project :okhttputils:
- debugApiElements
- debugRuntimeElements
- releaseApiElements
- releaseRuntimeElements
All of them match the consumer attributes:

微信截圖_20171113161754.png
okhttputils是集成封裝的,都用了好久了,平時屁事兒沒有,今天一升級就報出問題,這鍋肯定是因為升級,而不是okhttputils本身.
度娘了一番,最后把問題定位到apt.解決方法:
一:在project的gradle中,刪除:com.neenbedankt.gradle.plugins:android-apt

圖片.png
二,在module的gradle中,關(guān)于所有"apt"字段的,能刪除的刪除,不能刪除的考慮替換集成方式,當(dāng)然,一般都沒有能直接刪除的(捂臉),如:

圖片.png
碎碎念:
1 Android Gradle 插件 2.2 版本的發(fā)布后,Android Gradle 插件提供了名為 annotationProcessor 的功能來完全代替 android-apt ,自此android-apt 作者在官網(wǎng)發(fā)表聲明證實了后續(xù)將不會繼續(xù)維護(hù) android-apt ,并推薦大家使用 Android 官方插件annotationProcessor參考文章
2 如果有用,給個喜歡
更多問題加群:584275290