除了在 manifest.xml 里面
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="2" android:versionName="2.0" package="com.xxx.xxx">
还有build.gradle
可以通过 右键 App工程 Open module setting -> Flavors 也可以修改 version code 和 version name
也可以直接修改 build.gradle 文件
apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.xxx.xxx" minSdkVersion 14 targetSdkVersion 23 versionCode 2 versionName "2.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } productFlavors { } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.1' }