In build.gradle file, there is an attribute called versionCode. Whenever I make an update to the project, should I increase the value of versionCode?
android:versionCode —
An integer value that represents the version of the application code,
relative to other versions.
Typically, you would release the first version of your application
with versionCode set to 1, then monotonically increase the value with
each release, regardless whether the release constitutes a major or
minor release. This means that the android:versionCode value does
not necessarily have a strong resemblance to the application release
version that is visible to the user. Applications and publishing
services should not display this version value to users.
Screenshot of versionCode at Play Store Developer Console:
android:versionName —
A string value that represents the release version of the application
code, as it should be shown to users.
Screenshot of versionName in Already Published app at Play Store:
Summary: Version code is for keeping track of your application update, which is basically used when you upload a new apk in the Play Store. On the other hand versionName is a String that is visible to user so that they can see there's a new version available.
Source: Versioning Your Applications
You should increase the versionCode for any new version you plan to release on Google Play (or whatever other distribution channels you use) as an update to the existing version. For internal testing, you don't have to increment the versionCode since you can force a reinstall.
If u plan on publishing your app to playstore then each update must have different verionCode and versionName is simply for developers to keep track of major changes and updates.
You need to increase the value of version code only when you are publishing the app otherwise there is no need to increase it. You can continue with the same version code
Related
I wish to release a new app as public beta for Android and production for iOS. I wish to have the same version numbers for both. But, iOS doesn't allow version less than 1.0.0 for production, correct me if I am wrong.
So can I use version 1.x.x for an android public beta app?
Is there any restrictions in Google play to use appropriate version numbers?
You can use whatever versionName you want. The only thing that matters is the versionCodes have to increment. You can't upload a new APK with a matching or lower version code.
The versionName has no purpose other than to be displayed to users.
https://developer.android.com/studio/publish/versioning.html
On gradle you set "versionCode" with an integer, this integer must be necessarily superior to the previous version. check play console for help about alpha-beta versionCode hierarchies.
on the same gradle you set "versionName" string, the info that your apps users will see, this is a free textfield, you can use "1.x.x" or "1.xx.xx_beta"
productFlavors allows free texfields too
check the "app info" about apps instaled on your device and compare styles
I have uploaded my application on google play store under beta testing rollout for test purpose to find out if there are impersonation kind of issues.It got published. Now I have a very minor change in my application and would not like to unnecessarily change the version. So can I sign the apk and directly publish it on production .And what will happen to this beta production,anyway I do not wish to retain it,Or should I again upload it with new version on beta test and publish it to production? Any help in which should be the proper procedure is appreciated. Thank you :)
You will not be able to publish the same version code twice to the same release agent. BETA can have versioncode 1 for example and then Production can have versioncode 1, But you can not rebuild and release versioncode 1 again. It will not allow it.
Yes you can release two completely different builds to release vs beta and have both be version 1, but you are creating ambiguity.
BETA users will always have the latest versioncode app whether it comes from BETA or Release, so in this scenario it will likely default to production app as it will assume that BETA was promoted to production due to matching version code. Hope that makes sense.
Also, you do not have to change your version String so if you are going out as 1.00 you can still leave it as 1.00. This is the version string that you show to the user and name the release, you can reuse that as many times are you want, The version code is an arbitrary hidden integer value that google play makes you supply so it knows if it is newer or not. It is not visible to the user other, they will see your version String.
It depends what you mean by version. There is a version string which may be the same and there is a version number which must be different.
I sign the apk and directly publish it on production. And what will happen to this beta production? Anyway I do not wish to retain it. Should I again upload it with new version on beta test and publish it to production?
For your new build, increase the the versionCode to 1 more than the previous release's versionCode. Directly publish that to production. The version in the beta phase will by shadowed by the production version. Anyone having the beta app will see an Update, wherein they can update to the production version. In your Beta section on App Releases section, it will show like this:
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.
I need to publish my application first at alpha testing channel at play developer console and then to production. Lets say that I publish the application at alpha with version code 1.0.0. After testing it, I need to publish updates of the application so I increase the version code to 1.0.1, 1.0.2, etc.
After I finish testing, can I upload a new apk to production with an initial version code 1.0.0? I don't want to promote the apk published at the alpha channel that will have an increased version code i.e. 1.0.5. Will that cause any issues?
Do you have any other recommendation how to handle this case?
Thanks,
Lupe
In Android, application versioning consists of two things.
android:versionCode - An integer value that represents the version of the application code, relative to other versions.
android:versionName — A string value that represents the release version of the application code, as it should be shown to users.
What is visible to the users is the second one. So you can have for example a version in alpha where android:versionName is "1.0.0" and android:versionCode is 1 (integer), then do your testing and fixes and when you are ready to deploy in production keep android:versionName to "1.0.0" but have android:versionCode increased by 1 from the last value it had in alpha, e.g. android:versionName="1.0.0", android:versionCode=5 (the production is the 5th update from your initial aplha deploy). Of course you can change "1.0.0" to whatever you like, you can lower it too e.g. "0.9.0", it's android:versionCode that always should be incremented by 1.
You can read more here: Versioning Your Applications
Version codes need only to be unique. As per document system does not enforce that new apk should have a greater version code.
Though a device, having installed an apk with a higher version code (17 in your case) will neither get update notification from play store nor play store will show that an update is available, because apk has a lower version code (10 in your case). It does not matter that v10 is uploaded after v17.
Yes! Just yesterday I had versionCode 701 in the Alpha lane and wanted to publish a Beta from a different branch. The Alpha includes some features that are only available to our team, and the beta is a public Beta that doesn't have all the Alpha features merged in yet.
I hadn't used versionCode 700 yet, so I pushed that to the beta lane and it was accepted by the play store.
So, now, versionCode 700 is available for download to Beta testers, while versionCode 701 is in Alpha, and the Alpha version (701) was uploaded BEFORE the Beta version (700).
It seems like what matters is if the versionCode has been used yet. Hopefully that helps!
I have android app published in google play with the following version:
android:versionCode="1"
android:versionName="1.0"
I think that's the default version when creating android app in Eclipse IDE. I made minor changes in my app. I want to publish the updated app. What is the recommended versionCode and versionName for the updated app?
What I want is that users who already installed the app will be notified by google play that a new version is available. Im new to android development. In my device, I received notification for my installed app that there are new version available. I want this functionality.
I'm thinking of having:
android:versionCode="2"
android:versionName="1.0.1"
Is that OK?
thanks
Yes thats perfect.
Typically, you would release the first version of your application
with versionCode set to 1, then monotonically increase the value with
each release, regardless whether the release constitutes a major or
minor release. This means that the android:versionCode value does not
necessarily have a strong resemblance to the application release
version that is visible to the user (see android:versionName, below).
Applications and publishing services should not display this version
value to users.
As with android:versionCode, the system does not use this value for
any internal purpose, other than to enable applications to display it
to users. Publishing services may also extract the android:versionName
value for display to users.
Ref : Versioning Your Applications and versionCode vs versionName in Android Manifest
Yes that's correct.
The versionCode needs to increment but the versionName can be any string to be shown to your users.
See docs for fuller explanation: http://developer.android.com/tools/publishing/versioning.html