我的应用在android市场上的版本代码为2,版本名称为1.1
但是,今天更新的时候,我在manifest里把版本码改成了3,但是错误的把我的版本名改成了1.0.1,并把apk上传到了市场。
现在,我的应用程序的用户会在他们的手机上收到更新通知吗?还是我要重做一遍?
我的应用在android市场上的版本代码为2,版本名称为1.1
但是,今天更新的时候,我在manifest里把版本码改成了3,但是错误的把我的版本名改成了1.0.1,并把apk上传到了市场。
现在,我的应用程序的用户会在他们的手机上收到更新通知吗?还是我要重做一遍?
当前回答
它确实基于versionCode而不是versionName。然而,我注意到,改变AndroidManifest.xml中的versionCode对于Android Studio - Gradle构建系统是不够的。我需要在build.gradle中更改它。
其他回答
版本代码被谷歌播放商店用于新的更新。版本名显示给用户。 如果您增加了版本代码,则更新将对所有用户可见。
要了解更详细的信息,请花2分钟阅读这篇文章https://developer.android.com/studio/publish/versioning.html
我将给你我对我所能找到的关于这个主题的唯一文件的解释。
“例如检查升级或降级关系。”<-您可以降级应用程序。
你应该确保应用程序的每个后续版本都使用更大的值。系统不会强制执行此行为”<-数值应该增加,但您仍然可以降级应用程序。
android:versionCode — An integer value that represents the version of the application code, relative to other versions. The value is an integer so that other applications can programmatically evaluate it, for example to check an upgrade or downgrade relationship. You can set the value to any integer you want, however you should make sure that each successive release of your application uses a greater value. The system does not enforce this behavior, but increasing the value with successive releases is normative. Typically, you would release the first version of your application with versionCode set to 1, then monotonically increase the value with each release, regardless whether the release constitutes a major or minor release. This means that the android:versionCode value does not necessarily have a strong resemblance to the application release version that is visible to the user (see android:versionName, below). Applications and publishing services should not display this version value to users.
我猜用户仍然会收到更新通知,因为你增加了你的版本代码。但是您的版本名将显示为1.0.1给用户。
给定一个版本号MAJOR.MINOR。PATCH,增加:
当你进行不兼容的API更改时,MAJOR版本 以向后兼容的方式添加功能时为MINOR版本 当您进行向后兼容的错误修复时,PATCH版本。
版本代码和版本名称
如你所知,在android上,你必须为应用程序定义两个版本字段:版本代码(android:versionCode)和版本名称(android:versionName)。版本代码是一个增量整数值,表示应用程序代码的版本。版本名是一个字符串值,表示显示给用户的“友好”版本名。
参考链接
android: versionCode
内部版本号。此数字仅用于确定一个版本是否比另一个版本更新,数值越大表示更新版本。这不是显示给用户的版本号;该数字由versionName属性设置。 取值必须为整数,例如“100”。您可以任意定义它,只要每个后续版本都有一个更高的数字。[…]
android: versionName
显示给用户的版本名。此属性可以设置为原始字符串或字符串资源的引用。字符串除了显示给用户外没有其他用途。versionCode属性保存内部使用的重要版本号。
读到这里,很明显versionName只是显示给用户的东西,versionCode才是重要的。只要不断增加,一切都会好起来的。