错误

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. SFML从入门到放弃(1) 窗口和交互

    SFML从入门到放弃(1) 窗口和交互 创建一个新窗口: sf::RenderWindow window(sf::VideoMode(,),"new window"); 但是光创建 ...

  2. 初探 模拟退火算法 POJ2420 HDU1109

    模拟退火算法来源于固体退火原理,更多的化学物理公式等等这里不再废话,我们直接这么来看 模拟退火算法简而言之就是一种暴力搜索算法,用来在一定概率下查找全局最优解 找的过程和固体退火原理有所联系,一般来讲 ...

  3. mysql 代价

    mysql cbo cost base optimizer 基于代价,数据是一直变化的oracle8 以前是rbo rule base optimizer 基于规则, 如果sql使用了索引,必须使用索 ...

  4. KEY

    typedef struct st_key { uint key_length; /* Tot length of key */ ulong flags; /* dupp key and pack f ...

  5. Ubuntu下Nginx安装

    1.1 安装Nginx $sudo apt-get install nginx Ubuntu安装之后的文件结构大致为: 所有的配置文件都在/etc/nginx下,并且每个虚拟主机已经安排在了/etc/ ...

  6. [BZOJ 1937][Shoi2004]Mst 最小生成树

    传送门 $ \color{red} {solution:} $ 对于每条树边\(i\),其边权只可能变小,对于非树边\(j\),其边权只可能变大,所以对于任意非树边覆盖的树边有 \(wi - di & ...

  7. shell (2) 时间处理

    获取当前的时间,并输出 #!/bin/bash if [ $# -ne 1 ];then echo "input an dmesg time" exit 1 fi unix_tim ...

  8. system命令

    服务查看 查看所有服务运行状态: service --status-all chkconfig --list 查看单个服务的运行状态 service sshd status 查看启动状态,是否开机自动 ...

  9. 解决视图状态消息验证代码 (MAC) 错误

    https://blog.csdn.net/bingtingabc/article/details/49148745 2015年10月15日 10:05:56 bingtingabc 阅读数:3397 ...

  10. Zookeeper---系统学习

    1.概述 1.1 Zookeeper解决了什么问题? 分布式环境中    协调和管理服务    是一个复杂的过程: Zookeeper通过  其简单的架构和API  解决了这个问题,Zookeeper ...