Can an android version code start with 0 if it is greater than 1?

2k Views Asked by At

I am writing an app in Xamarin Forms and trying to upload an APK to HockeyApp. It is telling me that my version code must be 1 or higher. Is android:versionCode="023" valid, or does it have to start with a non-zero integer? I want something that closely resembles the release number, for example 0.2.3. Is this something that is unsupported, or is it a problem with HockeyApp?

2

There are 2 best solutions below

0
On BEST ANSWER

does it have to start with a non-zero integer?

YES, it should be or studio gives error as : the leading zero turns this number into octal so removing leading zero is better way

Ex: 023 to 23 in your case

https://developer.android.com/guide/topics/manifest/manifest-element.html

For example, it could be a build number. Or you could translate a version number in "x.y" format to an integer by encoding the "x" and "y" separately in the lower and upper 16 bits. Or you could simply increase the number by one each time a new version is released.

https://developer.android.com/studio/publish/versioning.html

versionCode — An integer used as an internal version number. This number is used only to determine whether one version is more recent than another, with higher numbers indicating more recent versions.

The value is an integer so that other apps can programmatically evaluate it, for example to check an upgrade or downgrade relationship.

0
On

Version codes mostly incremented by 1 and it has to be an integer value greater than the previous version. If you want to name with specific format, use version name for that

versionName "0.2.3"