How to change Android version and code version number?

后端 未结 10 801
悲哀的现实
悲哀的现实 2020-12-07 08:56

How to change Android version and code version number Android Studio? I want to change apk file (app) on Google Play and I need to change Android version and code version nu

10条回答
  •  情歌与酒
    2020-12-07 09:03

    You can manage your application versioning wisely by using the Advanced Build Version Plugin for Gradle.

    You just need to include the plugin in yout build.gradle:

    buildscript {
      repositories {
          jcenter()
      }
    
      dependencies {
          classpath 'org.moallemi.gradle.advanced-build-version:gradle-plugin:1.5.0'
      }
    }
    
    apply plugin: 'org.moallemi.advanced-build-version'
    

    And then you can use the versioning functions (and, obviously, customize them):

    advancedVersioning {
        nameOptions { }
        codeOptions { }
        outputOptions { }
    }
    
    def appVersionName = advancedVersioning.versionName
    def appVersionCode = advancedVersioning.versionCode
    

    For more information, take a look at the official documentation.

提交回复
热议问题