0

We originally programmed our app versions to be: 0.3.1, with patch releases being 0.3.2, 0.3.3 etc. A while back we made a mistake and labeled one version 0.30.4. After that we could no longer use the 3 digit format (ie: 0.3.5) and were forced to always use the new 4 digit format.

Well, the mistake was made again, 0.40.4 was the new format and we published a 0.40.41 which seems to have now forced us to a 5 digit format. And now we can't go back to the 4 digit format 0.40.5, it must be 5 digit format 0.40.50.

From our perspective 0.40.5 is greater than 0.40.41, but it seems both Android and iOS don't read version numbers the same way. It looks like they strip out the decimals and concatenate the whole number so its comparing 0405 against 04041 - and what we see/intend as a newer, higher version is actually lower the previous version number.

Is there any way to correct this so that we can get back using a 3 digit, or even 4 digit version code? Or any method to get Android/iOS to see 0.40.5 is actually higher than 0.40.41? We fear future mistakes could force us into lengthier version codes. Each time this has happened it caused an issue in how we process our server API calls forcing us add code to recognize the different version types.

rolinger
  • 2,787
  • 1
  • 31
  • 53

1 Answers1

0

Android apps have both a version code (positive integer) and a version name (string). In your question you are using dots, so it must be the version name. You can use any name you want, no problem in using 0.5.1 or whatever as your next version name.

The versionName has no purpose other than to be displayed to users.

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

The version code should never be displayed to the user, the only requirement is that you use a higher versionCode than the previous one.

For iOS see this answer: https://stackoverflow.com/a/38009895/7493938

Maybe this is a good moment to release the 1.0 version. ;)

Mario Huizinga
  • 780
  • 7
  • 14
  • thanks for this. Our goal is to get both Android and iOS reset to a more controllable versioning - but have both always be the same version per release. Currently we have only used the Cordova `config.xml` to set the version number. IE: ``. If we move to the above method, can we set `versionName='0.5.1' `while moving `versionCode` to something higher than 4072? As 4072 looks to be the current versionCode on Android (and iOS) – rolinger Mar 25 '22 at 12:01
  • I am not familiar with Cordoba. You will have to check the doc to find out how those config.xml values map to the standaard Android and iOS versions. – Mario Huizinga Mar 26 '22 at 17:39