亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

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

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

解決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

内乡县| 山阳县| 洪湖市| 资讯| 兴仁县| 定襄县| 沁源县| 南宫市| 赤城县| 陆良县| 武定县| 新乡市| 隆化县| 仁布县| 黄浦区| 富平县| 汝阳县| 周至县| 呼玛县| 广州市| 左权县| 泸溪县| 安顺市| 屏东市| 绩溪县| 兴山县| 天柱县| 德令哈市| 肇源县| 洛宁县| 平度市| 巴东县| 石城县| 鲁山县| 嘉兴市| 景宁| 库车县| 砚山县| 禹州市| 教育| 工布江达县|