I've seen lots of answers but most of them are out of date. I'm trying to publish my android application to Play Store using Azure DevOps pipelines.
I'm facing an issue with the version code of the APK. Getting the following error:
APK specifies a version code that has already been used
Anyone have an idea about how I can increment the version code and name that exist in AndroidManifest.xml. I think we should change it in the CI pipeline.
Here's my CD pipeline:
For every update that you add for your exisiting app, u will have to
increment its value.
To do so:
Open your build.gradle (Module: app)
Increase the Version Code by 1 to your exisiting version code. ( This should be a positive integer number only).
Also, change your Version Name to show differentiation.
Related
I added my app bundle to the Google Console for internal testing and the version was
version: 1.0.0+1
Now I want to add some fixes and so upgraded the app version and removed the build number
version: 1.0.1
But Google Play gives the below error
Version code 1 has already been used. Try another version code.
But if the the build number is optional as mentioned by the
documentation then why is it giving an error?
Will I always have to add build number and increment no matter the
major and minor versions?
https://docs.flutter.dev/deployment/android#updating-the-apps-version-number**
The version number is three numbers separated by dots, such as 1.0.0
in the example above, followed by an optional build number such as 1
in the example above, separated by a +.
in a Flutter project, what define the name of the version is the 1.0.1, but what define the count of the update is +1, so by setting version like this:
version: 1.0.1+1
you say 'the name of this version is 1.0.1, it's my first ( +1 ) update', so the next time when you set it like this:
version: 1.0.2+1
you say 'the name of this version is 1.0.2, it's my first ( +1 ) update'.
and here the Google play console throws that error to you to change it, it uses that +1 to know how it should list your app version in the console, so you need a different one every time you update your app, you need to do like this as an example:
version: 1.0.2+2
after the build, when you upload it, it will work fine.
But Note: if you uploaded for the next time with a different version, and they rejected it again for example the :
You must complete the advertising ID declaration before you can release an app that targets Android 13 (API 33). We'll use this declaration to provide safeguards in Play Console to accommodate changes to advertising ID in Android 13.
even if it's rejected, it remember new upload with that version code, so after fixing the issue, you need to either change again the version code and re-upload again, or you can in your console to delete the rejected previous uploaded app to it's version code.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed last year.
The community reviewed whether to reopen this question last year and left it closed:
Original close reason(s) were not resolved
Improve this question
I am trying to release a new version of my Android App.
I can upload the APK file but after I click the "Review" Button I am getting below error.
Review summary
Errors
Resolve these errors before starting the rollout of this release.
You can't rollout this release because it doesn't allow any existing users to upgrade to the newly added APKs.
Please note that this app was developed using CORDOVA
The app version details are as below image. The only difference from the previous and this new version is the Target SDK is changed from 24 to 26
Can someone please give some idea to fix this issue. Thanks for your help
I contacted the Google support and they replied within 24 hours.
The issue is the android:versionCode in the AndroidManifest.xml is lower than my previous release. After I fixed the issue I was able to release my app without any issue.
How I fixed the issue
I changed the android-versionCode to a higher value in <manifest tag in the config.xml file so AndroidManifest.xml has the higher value.
Full reply from Google
Hi,
Thanks for contacting Google Play Developer Support.
You're seeing that error message because your new APK has a lower version code than the previous APK. Newer APKs must always have a higher version code than the previous version, or the Play Store won't know that the new APK is an update. Please change your new APK's version code to be at least 206020.
Regards,
Google Play Developer Support
If your Old APK version is a higher number than your New APK version then you get this error.
It is not the version name that matters, that can actually be any string, it is only the version code which must always be higher than a previous version.
https://developer.android.com/studio/publish/versioning
To fix for Flutter
In pubspec.yaml it is the version line, and the number after the + sign is the one that must be higher than the Old Version Code shown in the Google Play Console screen as the "1 app bundle deactivated".
That would be 50 if this was your version line :
version: 1.0.0+50
I faced same issue, interestingly the versioncode(120001) of new release (12.0.0) was less than the versioncode(1104058) previous release (11.4.5)
I resolved this issue following this link Setting Android version code in Ionic 2
Update both versionCode and versionName.
minSdkVesion 16
targetSdkVesion 26
versionCode 2
versionName 1.1
In your config.xml file's <widget> element, add/increment the android-versionCode attribute by one:
<widget id="com.example.foo" version="1.0.1" android-versionCode="10001" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
After that, running a cordova clean android and cordova build android --release gave me an .apk that the Google Play Console accepted.
have you upgraded your versionCode from previous versionCode?
minSdkVesion 16
targetSdkVesion 26
versionCode 1 //you need to upgrade it from previous one
versionName 1.0
If you are Monaca Cloud IDE for building and you are facing this error You cannot make this version available because it does not allow existing users to upgrade to new APKs that have been added.
So here what is the problem, When you try to build APK then it generates a random number,
So make sure your new update version code is greater then this 10505
You can set in Monaca Cloud IDE version code
In the root of your project will be a config.xml file. It contains a widget node that has an attribute of version. 1.17.01 in Example: <widget id="com.myapp.mobile" version="1.17.01" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
During a cordova prepare operation, this config.xml file is merged into the manifest file for your platform (e.g. platforms\android\app\src\main\AndroidManifest.xml for Android). The merged manifest file will contain both a version code and version string generated from the version listed in the config.xml. Ex: <manifest android:hardwareAccelerated="true" android:versionCode="11701" android:versionName="1.17.01" package="com.myapp.mobile" xmlns:android="http://schemas.android.com/apk/res/android">
This version code 11701 will be what is listed on the play console.
To automatically set this version greater, you can add to your gradle.properties file a variable setting cdvVersionCodeForceAbiDigit=true which will automatically multiply the version by 10. Note this logic is laid out in the build.gradle file at the root of your platform app folder. There is other logic toggled with the cdvBuildMultipleApks variable to set different values based on product flavor (arm, x86, etc). But I think the recommended approach today is to upload a "bundle" and let Google automatically generate the separate apks for various device configurations.
first post for me. I posted this to Oculus forums also.
I am trying to update my Alpha build with a second APK but am receiving the following error:
An APK with this package name and version code already exists. Please
increment the version code and then resubmit your update.
My previously uploaded Alpha has a version of 1.0 and version code 1.
My new Android Manifest has the following:
android:versionCode="2" android:versionName="2.0"
so I have incremented both the version name and the version code but still get the error. Am I missing something?
Thanks
So it turns out that you also have to set the version number and code in Unity under Edit -> Project Settings -> Player -> Other. I was just setting the version number in the Manifest XML itself and hadn't heard of this setting in Unity.
So, I have read a lot of questions here, and I have found out that I shold change my android manifest. So now my android:versionCode = "2"
But still, when I try to upload the updated apk, I get the error in the title.
I am making a game in unity, using the plugin for Google mobile ads.
Your Version Code gets probably overridden by the one in the PlayerSettings
You have to change the version code in the build.gradle file as well :-)
I have already uploaded the beta version, with version code 1,
Now I m trying to upload the new version in Production mode. I am changing the versionCode from 1 to 2 and versionName from 1.0.0 to 1.0.1
Then I am genereating the signed APK.
But when I m trying to upload the apk, its showing "You need to use a different version code for your APK because you already have one with version code 1."
Please help me to get rid of the prob.
(Do it need to delete the previous signed apk file which i have created at the time of generating signed apk and create again)
You most likely changed your versionCode directly in your Manifest file. But if you use Android Studio, final Manifest file is generated and some parts may be overwritten during manifest merging phase (see blog post on what it is). So highlight your app module, press F4 and bump version code on Flavours tab.