Home Can an android version code start with 0 if it is greater than 1?
Reply: 2

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

CanadaIT
1#
CanadaIT Published in 2017-09-14 05:20:02Z

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?

Amit Vaghela
2#
Amit Vaghela Reply to 2017-09-14 05:55:00Z

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.

Samuel Robert
3#
Samuel Robert Reply to 2017-09-14 05:29:20Z

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"
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.315386 second(s) , Gzip On .

© 2016 Powered by cudou.com design MATCHINFO