I'm trying to automate publishing an app to the Google Play store using the Gradle Play Publisher. So far so good except that I haven't been able to update the version_name
this way, it just ignores it.
I Tried ./gradlew publishRelease -Dversion_name=3.0.0
. It looks like it's due to Google Play API limitations. If I run ./gradlew assembleRelease -Dversion_name=3.0.0
to generate the apk and then upload the apk manually it correctly uploads with the version 3.0.0
. Just want to make sure is it not possible to upload the version name vía Google Play Developer API or is it an issue of Gradle Play Publisher?
build.gradle
def version_name = System.getProperty("version_name")
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
minSdkVersion 16
targetSdkVersion 23
versionCode version_code
versionName "${version_name}"
renderscriptTargetApi 23
renderscriptSupportModeEnabled true
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
}
EDIT:
Following R. Zagórski suggestions I tried:
1.
./gradlew assembleRelease -Dversion_name=3.0.0 publishRelease
and
2.
./gradlew assembleRelease -Pversion_name=3.0.0 publishRelease
build.gradle
def version_name = project.getProperty("version_name")
println "version name: "+version_name
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
minSdkVersion 16
targetSdkVersion 23
versionCode version_code
versionName "${version_name}"
renderscriptTargetApi 23
renderscriptSupportModeEnabled true
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
...
}
But still nothing. Just to be clear the problem is not that I'm not getting the version_name
or the wrong version_name
in the build, in fact that println
you see there prints the right version. Is just that I'm not getting anything at all in the Google play store (see image below).