您的位置:首页 > 产品设计 > UI/UE

Cannot set the value of read-only property 'outputFile' for ApkVariantOutputImpl_Decorated{apkData=

2017-11-03 13:21 531 查看
问题描述:

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 { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
def fileName = outputFile.name.replace("app",
"${defaultConfig.applicationId}_${defaultConfig.versionName}_${releaseTime()}")
outputFileName = fileName

}

}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐