今天收到了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.
Open File
解决 :修改文件名代码请这样写
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中关闭APPT2 编译
android.enableAapt2=false
注:如果是eclipse转到as上的项目,可能没有gradle.properties文件,请在项目根目录中手动创建
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文件中的dependency apt 'com.jakewharton:butterknife-compiler:8.1.0' //改为 annotationProcessor 'com.jakewharton:butterknife-compiler:8.1.0'
热血大作战 安卓最新版v2.1.166
下载凡尔赛法环免广告版 最新版v1.69.1
下载天煞异种 安卓版v1.0.21
下载十三月 (Undecember)最新官方中文版v3.26.0200
下载星露谷物语sve 安卓版v1.5.6.52
星露谷物语sve手机版是游戏的超大拓展Mod内容,全称Sta
动物园大亨 手机版v2.0
动物园大亨是一款模拟动物园经营的休闲放置游戏,采用了卡通画风
蜜蜂园林钞票不减反增版 v0.1.68
蜜蜂园林无限道具版是游戏的破解版本,在该版本中为玩家提供了足
幻想熔炉失落帝国的世界 安卓版v2.16.2
幻想熔炉失落帝国的世界是一款魔法卡通风格的城市模拟经营类游戏
我的女友是声优免广告 安卓版v1
我的女友是声优免广告是一款非常好玩的模拟经营类手游,玩家在游