The following build.gradle code for my main or launcher module is not updating the versionCode to 2. When I try to update the apk in Google Play the website tells me the apk uploaded is still version 1. Anyone knows what the problem is? I did download and modify some existing code, so I'm not aware of all the build scripts. I'm not looking to auto increment the version code. At line 24 I code versionCode 2.
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
//Keep old ITEC package name as application Id for Play Store compatibility
// applicationId 'at.aau.itec.android.mediaplayerdemo'
// applicationId "com.gregmarsh.AndroidVideoCapture.VideoMetronome"
applicationId "com.gregmarsh.AndroidVideoCapture.WCSDanceOnTimePro"
minSdkVersion 16
targetSdkVersion 22
versionCode 2
versionName '1.1'
// versionCode 3
// versionName "1.2"
// //applicationId "com.exercise.com.exercise.AndroidVideoCapture.AndroidVideoCapture"
// applicationId "com.gregmarsh.AndroidVideoCapture.VideoMetronome"
// minSdkVersion 16
// targetSdkVersion 22
// // versionCode 1 Name "1.0" 10/28/2015 Initial release
// // versionCode 2 Name "1.1" 1/4/2016 Recorded video listed in gallery
// // versionCode 3 Name "1.2" 4/3/2016 Flash & beat sync adjusted, recording stops on phone call.
// versionCode 3
// versionName "1.2"
buildConfigField "boolean", "CRASHLYTICS_CONFIGURED", "${isChrashlyticsConfigured()}"
}
signingConfigs {
debug // configured in signingconfig.gradle
release // configured in signingconfig.gradle
}
buildTypes {
debug {
applicationIdSuffix ".debug"
versionNameSuffix "-debug"
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
if (variant.name == android.buildTypes.release.name) {
def file = output.outputFile
def fileName = file.name.replace(".apk", "-" + defaultConfig.versionCode + "-" + defaultConfig.versionName + ".apk")
output.outputFile = new File(file.parent, fileName)
}
}
}
lintOptions {
// Lint fix for Okio: https://github.com/square/okio/issues/58
warning 'InvalidPackage'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':MediaPlayer')
compile project(':MediaPlayer-DASH')
compile('com.crashlytics.sdk.android:crashlytics:2.5.6@aar') {
transitive = true;
}
compile 'com.android.support:appcompat-v7:22.2.1'
}
ext.isLibrary = false
apply from: "../gitversioning.gradle"
apply from: "signingconfig.gradle"
if (isChrashlyticsConfigured()) {
apply plugin: 'io.fabric'
}
def isChrashlyticsConfigured() {
return file("fabric.properties").exists()
}