版本码是否有最大值? [英] Is there a max value for versioncode?

查看:108
本文介绍了版本码是否有最大值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们必须通过某个任意数字来增加 versionCode ,才能将其发布到Google Play。

是否有限制该值以及会发生什么

  defaultConfig {
applicationIdmy.app
minSdkVersion 15
targetSdkVersion 22
versionCode 65
versionName1.05
setProperty(archivesBaseName,myapp- $ versionCode)

}
长整型数据库。
source )。 long 的最大值是 9,223,372,036,854,775,807 ,所以您不应该在这里遇到关于长度的任何问题。



请注意,在旧的Android版本中它仍然是 int ,所以这只与您的 minSdkVersion 是Android P或更高版本。


We always have to increment versionCode by some arbitary number to publish it to google play.
Is there limit to that value and what will happen if it is reached?

defaultConfig {
        applicationId "my.app"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 65
        versionName "1.05"
        setProperty("archivesBaseName", "myapp-$versionCode")

    }

解决方案

Starting at Android P, the version code will be a long (source). The max value of a long is 9,223,372,036,854,775,807 so you shouldn't run into any issues regarding length here.

Do note that it's still an int in older android versions, so this is only relevant to you when your minSdkVersion is Android P or higher.

这篇关于版本码是否有最大值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆