中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

解決Android studio 2.3升級到Android studio 3.0 后apt報錯問題

發布時間:2020-09-16 19:59:42 來源:腳本之家 閱讀:191 作者:哈特中尉 欄目:移動開發

1.現象描述

原來項目在Android studio 2.3一切正常,升級3.0之后報如下錯誤:

Error:Cannot choose between the following configurations of project :android_sdk:
 - debugApiElements
 - debugRuntimeElements
 - releaseApiElements
 - releaseRuntimeElements
All of them match the consumer attributes:
 - Configuration 'debugApiElements':
   - Found com.android.build.api.attributes.BuildTypeAttr 'debug' but wasn't required.
   - Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
   - Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required.
   - Found org.gradle.api.attributes.Usage 'java-api' but wasn't required.
 - Configuration 'debugRuntimeElements':
   - Found com.android.build.api.attributes.BuildTypeAttr 'debug' but wasn't required.
   - Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
   - Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required.
   - Found org.gradle.api.attributes.Usage 'java-runtime' but wasn't required.
 - Configuration 'releaseApiElements':
   - Found com.android.build.api.attributes.BuildTypeAttr 'release' but wasn't required.
   - Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
   - Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required.
   - Found org.gradle.api.attributes.Usage 'java-api' but wasn't required.
 - Configuration 'releaseRuntimeElements':
   - Found com.android.build.api.attributes.BuildTypeAttr 'release' but wasn't required.
   - Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
   - Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required.
   - Found org.gradle.api.attributes.Usage 'java-runtime' but wasn't required.

2.解決辦法:

project的build.gradle文件中刪除

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

module的build.gradle文件中刪除

apply plugin: 'com.neenbedankt.android-apt'

module的build.gradle文件中替換

//apt 'com.jakewharton:butterknife-compiler:8.0.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.0.1'

ps:下面再給大家補充介紹android studio更新到3.0后,不支持apt問題

android studio更新到3.0后,不支持apt了,適配僅需要修改以下兩點:

1.移除module目錄下的build.gradle中的 apply plugin: 'android-apt' 

2.將apt改成annotationProcessor

例如:

apt 'com.google.dagger:dagger-compiler:2.0.2'

改成

annotationProcessor 'com.google.dagger:dagger-compiler:2.0.2'

總結

以上所述是小編給大家介紹的解決Android studio 2.3升級到Android studio 3.0 后apt報錯問題,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對億速云網站的支持!

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

两当县| 靖宇县| 宝丰县| 花莲县| 竹山县| 汕头市| 宁德市| 宜黄县| 阿鲁科尔沁旗| 翁源县| 都江堰市| 荣昌县| 海阳市| 喜德县| 靖边县| 盘山县| 万载县| 潼关县| 兴化市| 南充市| 繁峙县| 陈巴尔虎旗| 龙井市| 琼海市| 十堰市| 寿宁县| 宁波市| 北川| 资中县| 凯里市| 东明县| 竹山县| 许昌县| 定兴县| 凌云县| 安图县| 江达县| 延吉市| 景谷| 无为县| 元阳县|