Android Studio升級(jí)3.0,打開(kāi)以前的老項(xiàng)目后又給我?guī)?lái)了一神坑,如圖:
Error:Cannot choose between the following configurations of project :okhttputils:
- debugApiElements
- debugRuntimeElements
- releaseApiElements
- releaseRuntimeElements
All of them match the consumer attributes:
微信截圖_20171113161754.png
okhttputils是集成封裝的,都用了好久了,平時(shí)屁事兒沒(méi)有,今天一升級(jí)就報(bào)出問(wèn)題,這鍋肯定是因?yàn)樯?jí),而不是okhttputils本身.
度娘了一番,最后把問(wèn)題定位到apt.解決方法:
一:在project的gradle中,刪除:com.neenbedankt.gradle.plugins:android-apt
圖片.png
二,在module的gradle中,關(guān)于所有"apt"字段的,能刪除的刪除,不能刪除的考慮替換集成方式,當(dāng)然,一般都沒(méi)有能直接刪除的(捂臉),如:
圖片.png
碎碎念:
1 Android Gradle 插件 2.2 版本的發(fā)布后,Android Gradle 插件提供了名為 annotationProcessor 的功能來(lái)完全代替 android-apt 岖妄,自此android-apt 作者在官網(wǎng)發(fā)表聲明證實(shí)了后續(xù)將不會(huì)繼續(xù)維護(hù) android-apt 白翻,并推薦大家使用 Android 官方插件annotationProcessor參考文章
2 如果有用,給個(gè)喜歡
更多問(wèn)題加群:584275290