Android Studio 2.x

applicationVariants.all { variant ->        variant.outputs.each { output ->                def outputFile = output.outputFile                if (outputFile != null && outputFile.name.endsWith('.apk')) {                    // 这里修改apk名称                    def fileName =  "hello_${defaultConfig.versionName}.apk"                    output.outputFile = new File(outputFile.parent, fileName)                }        }}

使用AS3时这样设置会遇到错误:Cannot set the value of read-only property ‘outputFile’

Android Studio 3

android.applicationVariants.all { variant ->    variant.outputs.all {        outputFileName = "hello_${defaultConfig.versionName}.apk"    }}

参考:https://stackoverflow.com/questions/44239235/android-gradle-3-0-0-alpha2-plugin-cannot-set-the-value-of-read-only-property

更多相关文章

  1. Android通讯
  2. ch024 Android(安卓)BroadCastReceiver
  3. ch024 Android(安卓)BroadCastReceiver
  4. android 开发中遇到错误及解决办法总结(在别处看到的)
  5. Android: 下载并编译Android(安卓)Source Tree
  6. 更新Android(安卓)SDK, 升级ADT遇到的问题总结
  7. Android(安卓)字体颜色变化(点击)
  8. Android(安卓)'showAsAction' in package 'android'错误解决
  9. Android(安卓)错误 'roundIcon' in package 'android'

随机推荐

  1. mysql5.7.17安装配置图文教程
  2. MySQL v5.7.18 解压版本安装详细教程
  3. mysql 5.7.18 安装教程及问题汇总
  4. CentOS6.8使用cmake安装MySQL5.7.18
  5. mysql 5.7.18 winx64安装配置方法图文教
  6. windows10安装mysql5.7.18教程
  7. MySQL 复制详解及简单实例
  8. mysql 5.7.18 winx64 免安装 配置方法
  9. InnoDB实现序列化隔离级别的方法
  10. mysql创建本地用户及赋予数据库权限的方