Android 和 iOS 上的应用程序版本问题
我们最初将应用程序版本设置为:0.3.1
,补丁版本为 0.3.2
、0.3.3
等。我们犯了一个错误,将一个版本标记为 0.30.4
。此后,我们无法再使用 3 位数字格式(即:0.3.5),而被迫始终使用新的 4 位数字格式。
好吧,错误又犯了,0.40.4
是新格式,我们发布了 0.40.41
,它现在似乎迫使我们采用 5 位数字格式。现在我们不能再回到4位数字格式0.40.5
,它必须是5位数字格式0.40.50
。
从我们的角度来看,0.40.5
大于 0.40.41
,但 Android 和 iOS 似乎并不以相同的方式读取版本号。看起来他们去掉了小数并连接了整个数字,因此将 0405
与 04041
进行比较 - 我们看到/打算作为一个更新、更高的版本实际上是更低的以前的版本号。
有没有什么方法可以纠正这个问题,以便我们可以使用 3 位甚至 4 位版本代码来恢复?或者有什么方法可以让 Android/iOS 看到 0.40.5
实际上高于 0.40.41
?我们担心未来的错误可能会迫使我们使用更长的版本代码。每次发生这种情况时,都会导致我们处理服务器 API 调用的方式出现问题,迫使我们添加代码来识别不同的版本类型。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Android 应用程序同时具有版本代码(正整数)和版本名称(字符串)。在您的问题中,您使用了点,因此它必须是版本名称。您可以使用任何您想要的名称,使用 0.5.1 或其他名称作为下一个版本名称没有问题。
请参阅 https://developer.android.com/studio/publish/versioning
版本代码永远不应该显示给用户,唯一的要求是您使用比前一个版本更高的版本代码。
对于 iOS,请参阅此答案:https://stackoverflow.com/a/38009895/7493938
也许这是一个好时机发布1.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.
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. ;)