I've been facing a serious problem lately with Android Studio, where the versionCode specified in the build.gradle file is not taken into account.
It happened twice now, and the first time it just worked for no reason after countless tries. It's either this or the Google Developer Console has some sort of bug which doesn't correctly detect the versionCode.
I tried editing it manually as well as with the build flavors, I always get an error message from Google when trying to upload the update, specifying the old versionCode.
(I am also changing the versionName)
You have to update both versionCode & versionName to higher values
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
Improve this question
I have an app on Google Play that, after an update, always shows the update button. Even if it's already updated and the latest version is shown in app settings, Google Play keeps asking me to update it. What can the problem be? This only happens with this single application. I tried to delete all caches and data (both for play store and the app), but with no results.
I've contacted Google Play support:
UPDATE 2 :
UPDATE 1 :
Problem solved guys,Google play finally fix their problem by sending an update of (Google Play Libraries), so you don't need to do anything. if you still seeing the UPDATE button,just clear the cache of Google Play from setting.
We had the same problem, we think it was a bug of the Play Store, because there were more people reporting the same behavior.
To fix it, we simply re-upload the app with a higher versionCode.
There is a temporary fix which is publishing a new update (as usual with a higher version code), but it's kind of a hit or miss, if it worked for you then don't upload another update until google fixes this issue because if you do then the same problem might recur (probably, because it happened to me twice in the past two days)
upload a new version with different incremented versionCode
versionCode 20181202
versionName '2.0.0'
and the most important
wait for 1/2 to 1 hour for Google Play to update the app.
I had the same problem and I'll tell you how I solved it. It doesn't make much sense what I did, but I'll tell you in case it can help you.
In my build.gradle file I have several configurations to generate my application and each of them has a different versionCode. What I did was to set the same value in all configurations with the latest versionCode value.
defaultConfig {
applicationId "xxxx"
..
versionCode NN
versionName "x.y"
}
productFlavors {
free {
applicationId "xxxx"
....
versionCode NN
versionName "x.y"
}
pro {
applicationId "xxxx"
....
versionCode NN
versionName "x.y"
}
}
It doesn't make much sense because I generate my app with one configuration and the other configurations don't matter. Maybe there's an error and it takes into account the default configuration. Maybe it was a coincidence and when uploading another new version it was fixed. I also wrote to google support and they may have fixed it but they haven't responded yet.
I know it doesn't make much sense but I'll tell you what I did in case it can help you.
Good luck.
I've exactly the same issue. I contacted Google Developer support thrice. Today I got a reply, this is the latest email I received from them.
PS: I released my update(new version) from Android Studio v3 update! All my prior versions were developed using Android Studio v2.X.X. Not sure, but if that matters..
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
Improve this question
I have an app on Google Play that, after an update, always shows the update button. Even if it's already updated and the latest version is shown in app settings, Google Play keeps asking me to update it. What can the problem be? This only happens with this single application. I tried to delete all caches and data (both for play store and the app), but with no results.
I've contacted Google Play support:
UPDATE 2 :
UPDATE 1 :
Problem solved guys,Google play finally fix their problem by sending an update of (Google Play Libraries), so you don't need to do anything. if you still seeing the UPDATE button,just clear the cache of Google Play from setting.
We had the same problem, we think it was a bug of the Play Store, because there were more people reporting the same behavior.
To fix it, we simply re-upload the app with a higher versionCode.
There is a temporary fix which is publishing a new update (as usual with a higher version code), but it's kind of a hit or miss, if it worked for you then don't upload another update until google fixes this issue because if you do then the same problem might recur (probably, because it happened to me twice in the past two days)
upload a new version with different incremented versionCode
versionCode 20181202
versionName '2.0.0'
and the most important
wait for 1/2 to 1 hour for Google Play to update the app.
I had the same problem and I'll tell you how I solved it. It doesn't make much sense what I did, but I'll tell you in case it can help you.
In my build.gradle file I have several configurations to generate my application and each of them has a different versionCode. What I did was to set the same value in all configurations with the latest versionCode value.
defaultConfig {
applicationId "xxxx"
..
versionCode NN
versionName "x.y"
}
productFlavors {
free {
applicationId "xxxx"
....
versionCode NN
versionName "x.y"
}
pro {
applicationId "xxxx"
....
versionCode NN
versionName "x.y"
}
}
It doesn't make much sense because I generate my app with one configuration and the other configurations don't matter. Maybe there's an error and it takes into account the default configuration. Maybe it was a coincidence and when uploading another new version it was fixed. I also wrote to google support and they may have fixed it but they haven't responded yet.
I know it doesn't make much sense but I'll tell you what I did in case it can help you.
Good luck.
I've exactly the same issue. I contacted Google Developer support thrice. Today I got a reply, this is the latest email I received from them.
PS: I released my update(new version) from Android Studio v3 update! All my prior versions were developed using Android Studio v2.X.X. Not sure, but if that matters..
I published my android application in Play Market two days ago. Today I made update of this application. I changed the versionCode in build.gradle from 1 to 2, and versionName from "1.1" to "1.1.1". When I had uploaded the apk file in Google Play Console, the browser crashed. When I had uploaded the apk file again, I got this error:
You need to use a different version code for your APK because you already have one with version code 2.
however there is only one version of my application in "APKs to diactivate" block and there are no APKs in "APKs to add" block.
How can I solve this problem? Thanks in advance!
I found the solution: I pressed "ADD APK FROM LIBRARY" button and there was my apk)
You can do this things
Try to push an apk with version code 3
Make sure the apk you are generating is the apk you are uploading
You are probably facing a very especific issue.
Just change your versionCode to 3 and move on ;)
This is quite strange situation. I have an android app in the market. Current version is 1.5.1 uploaded on 18th June. Google play is also displaying as last production release. This release has version code 25. yesterday I wanted to do another upload with version code 26 but I only saved as draft.
But google play shows me a notification that my release is live in the store
This release had 1.6 as release name but in the store is still 1.5.1. So I wanted to do another release with 1.6. now it tells me that "You need to use a different version code for your APK because you already have one with version code 26". I dont have this release draft also. It doesn't even appear anywhere. it is not also live in the store.
Does anybody have something similar? is it safe to make a new release with code 27 now? because Last release in the market is 25. so I will skip 1 number. will users receive update?
Yes, it's best to go change your version code to 27. Yes, users will receive the update.
If you can't find it, go to the build.gradle and set the version code and name inside the defaultConfig element
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
You can then upload it. Google only checks the gradle file to manage versions. But the users' client devices have no check. They will update it if the option is checked.
According to the official documentation (Versioning your applications), the "android:versionCode" must be increased with every release of an Android application.
For release versions supposed to be uploaded to Google Play, I understand why this is necessary. However, what about nightly builds, mainly aimed at developers? For these, the versionCode would need to be generated, which is not straightforward (SCM like Git without numeric commit id, possibly multiple builds from the same commit etc.).
So, my question:
Can I just use a constant versionCode for nightly builds? What consequences will this have (apart from not being able to upload to Google Play)?
Can I just use a constant versionCode for nightly builds?
Sure. That's what happens every time you run your app from your IDE, after all, unless you have scripted something (e.g., in Gradle) yourself to generate a unique versionCode.
What consequences will this have (apart from not being able to upload to Google Play)?
Nothing that's any different from doing builds in the IDE, other than things that are more tied to doing centralized builds, more so than versionCode (e.g., certificate mismatch errors, unless everyone and the CI server are synchronized to use the same debug keystore).
VersionCode is used to upgrade your apps, if you are using the same versionCode in your ease release, it will oveeride your apk file and don't able to install your new release file in which you have made some changes in it
In android you have versionCode and versionName by default. versionCode is an integer that is used by Google Play Store to make sure that you are uploading a new version of the app
For e.g. If you are releasing your fisrt app to playstore, your versionCode is android:versionCode="1" and if you're releasing your second version, your android:versionCode="2", so it will always increasing.