错误

Gradle sync failed: Cannot set the value of read-only property 'outputFile'

原因

gradle打包,自定义apk名称代码报错

解决

看不懂代码就把原来的注释了,自己再写一个

例如:

// rename the apk with the version name
/*
applicationVariants.all { variant ->
variant.outputs.each { output ->
output.outputFile = new File(
output.outputFile.parent + "/${variant.buildType.name}",
"osc-android-${variant.versionName}-${variant.productFlavors[0].name}.apk".toLowerCase()) }
}
*/
android.applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "oschain_${defaultConfig.versionName}.apk"
}
}

Gradle sync failed: Cannot set the value of read-only property 'outputFile'的更多相关文章

  1. Gradle sync failed: Gradle version 2.2 is required. Current version is 2.10.

    Gradle sync failed: Gradle version 2.2 is required. Current version is 2.10. If using the gradle wra ...

  2. Gradle sync failed: failed to find Build Tools revision 21.1.2

    从github上下载了一个开源项目到Android Studio 出现以下问题: 下午2:56:05 Gradle sync started下午3:00:11 Gradle sync failed: ...

  3. Android Studio 首坑 Gradle sync failed: Cause: error in opening zip file 的错误

    前言 今天安装Android studio 2.3.1时发生了一个错误,安装完成后创建第一个Hello World项目是报错.经过这个百度后,结果没有一个靠谱的.将拆解经过记录一下. 环境: 操作系统 ...

  4. Gradle sync failed 异常

    今天开发过程中出现如下异常 Gradle sync failed: Connection timed out: connect. If you are behind an HTTP proxy, pl ...

  5. Android Stutio 3.0 - Gradle sync failed

    0.Android Studio 权威教程 (url:http://blog.csdn.net/column/details/zsl-androidstudio.html) 1. 项目老是报错: Gr ...

  6. 【error】Gradle sync failed: Unable to start the daemon process.【已解决】

    ---恢复内容开始--- 在克隆GIT项目后,Android Studio 报错: Gradle sync failed: Unable to start the daemon process. Th ...

  7. Android:Gradle sync failed: Another 'refresh project' task is currently running for the project

    android studio 克隆项目后,重新导入后显示Gradle sync failed: Another 'refresh project' task is currently running ...

  8. Gradle sync failed: Read timed out

    : Gradle sync started : Gradle sync failed: Read timed out Consult IDE log m s ms) 原因是Gradle下载超时 一.下 ...

  9. Gradle sync failed: Cause: org.gradle.logging.StyledTextOutput$Style Consult IDE log for more details

    环境 Android studio 3.0 导入开源中国: ... dependencies { //noinspection GradleDependency classpath 'com.andr ...

随机推荐

  1. Arch下error: signature from "NAME<EMAIL ADD>"

    pacman的unknown trust问题错误消息类似于:error: signature from "NAME<EMAIL ADD>" is unknown tru ...

  2. ArchLinux 下 virtualbox 报错 libQtCore.so.4: cannot open shared object file

    VirtualBox: supR3HardenedMainGetTrustedMain: dlopen("/usr/lib/virtualbox/VirtualBox.so",) ...

  3. 高德地图API获取天气

    1.建立行政区规划清单表 use edw; drop table if exists dim_prov_city_adcode; create table if not exists dim_prov ...

  4. miniui表单验证守则总结

    1,页面效果图 2,代码实现   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "h ...

  5. loj6570 毛毛虫计数(生成函数FFT)

    link 巨佬olinr的题解 <-- olinr很强 考虑生成函数 考虑直径上点数>=4的毛毛虫的直径,考虑直径中间那些节点以及他上面挂的那些点的EGF \(A(x)=\sum_{i\g ...

  6. Using Request Headers for Metadata Address

    问题描述 我将一个在本地调试正常的service部署到服务器后遇到了添加服务引用失败的问题.在把配置文件中基址使用的localhost替换成服务器的ip地址后问题得到了解决.但我感觉这并不是一个因为粗 ...

  7. 题目1042:Coincidence(最长公共子序列)

    问题来源 http://ac.jobdu.com/problem.php?pid=1042 问题描述 给定两个字符串,求其最长公共子序列(LCS). 问题分析 网上是在是太多这类问题的文章了,随便贴一 ...

  8. HTML-CSS样式表-★★★常用属性★★★及基本概念、分类、选择器

    样式属性 背景与前景: background-color:#F90; /*背景颜色,样式表优先级最高*/ background-image:url(路径); /*设置背景图片(默认)*/ backgr ...

  9. train loss与test loss结果分析

    train loss 不断下降,test loss不断下降,说明网络仍在学习; train loss 不断下降,test loss趋于不变,说明网络过拟合; train loss 趋于不变,test ...

  10. makedown学习笔记(以后可能会用makedown写博客)

    学习手册 https://www.zybuluo.com/mdeditor?url=https%3A%2F%2Fwww.zybuluo.com%2Fstatic%2Feditor%2Fmd-help. ...