在打包签名之前,在相应的module的build.gradle中添加如下代码
<pre name="code" class="java">    applicationVariants.all { variant ->          variant.outputs.each { output ->              def oldFile = output.outputFile              def newName = 'luckpan';              if (variant.buildType.name.equals('release')) {  //                println(variant.productFlavors[0].name)                  def releaseApkName = 'study-' + defaultConfig.versionName + '-luckpan.apk'                  output.outputFile = new File(oldFile.parent, releaseApkName)              }              if (variant.buildType.name.equals('beta')) {                  newName = oldFile.name.replace(".apk", "-v" + defaultConfig.versionName + "-build" + getDate() + ".apk")                  output.outputFile = new File(oldFile.parent, newName)              }              if (variant.buildType.name.equals('debug')) {                }          }      }  

更多相关文章

  1. NPM 和webpack 的基础使用
  2. Android(安卓)(ListActivity、Contextmenu)微信类消息置顶和删除和
  3. 为什么在AndroidManifest.xml中Activity的theme用不了Theme.Ligh
  4. Android中的Bundle类
  5. Android(安卓)library projects cannot be launched
  6. Android(安卓)Kotlin开发模块之间跳转-ARouter
  7. Android(安卓)Bundle类
  8. android RN 配置和打包命令
  9. Android百度地图一种简单实现多标注及响应时间的方法

随机推荐

  1. android设置默认程序&清除默认设置
  2. android gps ,wifi ,基站定位集合
  3. 关于java.lang.NoSuchMethodException: [
  4. Android实现简单画图画板
  5. Android 调用intent 拍照
  6. Mac 真机调试android程序
  7. Android(安卓)Launcher全面剖析
  8. android 安装内核module,提示Required key
  9. flutter 打包 flutter build apk 报错Pro
  10. android 里的actionbar最右边的overflow