国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統(tǒng) > Android > 正文

詳解升級Android Studio3.0時遇到的幾個問題

2019-10-22 18:24:45
字體:
供稿:網(wǎng)友

?今天收到了Android Studio3.0更新推送,在升級過程中遇到幾個問題,在這里把問題和解決方法記錄下,方便要升級的童鞋。如果還有童鞋遇到不同的問題,也可以評論下我做下記錄

1.gradle打包,自定義apk名稱代碼報錯(Cannot set the value of read-only property 'outputFile' )

報錯

Error:(56, 0) Cannot set the value of read-only property 'outputFile' for ApkVariantOutputImpl_Decorated{apkData=Main{type=MAIN, fullName=debug, filters=[]}} of type com.android.build.gradle.internal.api.ApkVariantOutputImpl.
<a href="openFile:D:/eclipseCode/ipay-android/xinlebao/build.gradle" rel="external nofollow" >Open File</a>?

解決 :修改文件名代碼請這樣寫

android.applicationVariants.all { variant ->        variant.outputs.all {          outputFileName = "xinlebao_${defaultConfig.versionName}_${releaseTime()}.apk"        }      }

2. AAPT2 編譯報錯 AAPT2 error

報錯

Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details

解決:在gradle.properties中關(guān)閉APPT2 編譯

android.enableAapt2=false

注:如果是eclipse轉(zhuǎn)到as上的項目,可能沒有g(shù)radle.properties文件,請在項目根目錄中手動創(chuàng)建

3.apt插件問題(Error:Cannot choose between the following configurations of project :mylibrary:)

報錯:

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

- 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文件中的dependencyapt 'com.jakewharton:butterknife-compiler:8.1.0'//改為annotationProcessor 'com.jakewharton:butterknife-compiler:8.1.0'

其他使用apt的依賴,也要這樣更改

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持VEVB武林網(wǎng)。


注:相關(guān)教程知識閱讀請移步到Android開發(fā)頻道。
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 青浦区| 睢宁县| 江安县| 永川市| 合水县| 罗平县| 潢川县| 黑水县| 唐山市| 桐柏县| 泽库县| 五河县| 远安县| 噶尔县| 台安县| 固安县| 深水埗区| 琼海市| 织金县| 莲花县| 桐乡市| 北流市| 洛宁县| 泗洪县| 台北县| 潢川县| 定安县| 锦州市| 南丹县| 武强县| 文安县| 紫金县| 郓城县| 工布江达县| 宁乡县| 万载县| 西乌珠穆沁旗| 阿图什市| 日土县| 西昌市| 皋兰县|