How to change Android version and code version number?

后端 未结 10 788
悲哀的现实
悲哀的现实 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:17

    Android version and code version number change on Android Studio >= 3.6:

    Two ways to achieve this:

    1. Direct on the Android project by Open Flutter project and modify the file

      local.properties

    change the following values. Example:

    flutter.buildMode=release
    flutter.versionName=3.0.0
    flutter.sdk=C\:\\src\\flutter
    sdk.dir=C\:\\Users\\vgonza\\AppData\\Local\\Android\\sdk
    flutter.versionCode=30
    
    1. Open pubspec.yaml

    Change the

    version: 2.0.0+8
    

    Meaning: The version name is 2.0.0 The version code is 8

    See example by Suragch in:

    How to set build and version number of Flutter app

    0 讨论(0)
  • 2020-12-07 09:21

    The easiest way to set the version in Android Studio:

    1. Press SHIFT+CTRL+ALT+S (or File -> Project Structure -> app)

    Android Studio < 3.4:

    1. Choose tab 'Flavors'
    2. The last two fields are 'Version Code' and 'Version Name'

    Android Studio >= 3.4:

    1. Choose 'Modules' in the left panel.
    2. Choose 'app' in middle panel.
    3. Choose 'Default Config' tab in the right panel.
    4. Scroll down to see and edit 'Version Code' and 'Version Name' fields.
    0 讨论(0)
  • 2020-12-07 09:22

    Open your build.gradle file and make sure you have versionCode and versionName inside defaultConfig element. If not, add them. Refer to this link for more details.

    0 讨论(0)
  • 2020-12-07 09:29

    I didn't get the other answers to work in Android Studio 1.4. But this worked: click on your app name to the left below the main ribbon. It will show a list of files. Open AndroidManifest.xml and change the version code and version number there.

    0 讨论(0)
提交回复
热议问题