简体   繁体   English

APK的不同版本代码,带有phonegap构建的Android应用程序

[英]Different version code for APK, android app with phonegap build

When I trying to upload my app on google play, this errormessage is displayed: 当我尝试在Google Play上传我的应用时,会显示以下错误消息:

You need to use a different version code for your APK because you already have one with version code 1.

Im downloading my APK from my phonegap build. 我从我的phonegap版本下载我的APK。

My question is: 我的问题是:

In what file can I change the version number? 我可以在哪个文件中更改版本号?

I have tried to change in androidmanifest.xml, Version code and Version name 我试图改变androidmanifest.xml,版本代码和版本名称

Thanks! 谢谢!

You should specify the version code attribute in the "config.xml", Note that version code attribute should be like that android-versionCode="2" , as shown in below example: 您应该在“config.xml”中指定版本代码属性,请注意版本代码属性应该类似于android-versionCode =“2”,如下例所示:

<?xml version='1.0' encoding='utf-8'?>
<widget id="ca.anything.anything.any"
    android-versionCode="2"
    version="1.0.3"
    xmlns="http://www.w3.org/ns/widgets"
    xmlns:cdv="http://cordova.apache.org/ns/1.0"
    xmlns:rim="http://www.blackberry.com/ns/widgets">
    <name>Application Name</name>
....
</widget>

When uploading to PhoneGap Build, the manifest file isn't included. 上传到PhoneGap Build时,不包括清单文件。 Try changing the version and versionCode attributes in PhoneGap's config.xml instead. 尝试更改PhoneGap的config.xml中的version和versionCode属性。

通常,您必须在AndroidManifest.xml中设置应用程序版本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM