上传失败:您的APK需要使用其他版本代码,因为您已经有一个使用版本代码 [英] Upload failed: You need to use a different version code for your APK because you already have one with version code

查看:906
本文介绍了上传失败:您的APK需要使用其他版本代码,因为您已经有一个使用版本代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

情况:

对于这个问题已经被问过三次了,请您提前表示抱歉.但是这些解决方案都不适合我.

Sorry in advance if this question has been asked already three times. But none of those solutions are working for me.

我需要将新版本上传到我的Ionic应用程序的Google Play.上传过程一直运行良好,但是这次我收到此错误:

I need to upload a new version to Google Play of my Ionic app. The upload process it has always worked fine but this time i get this error:

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

发布过程:

我没有使用Android Studio.

I am not using Android Studio.

要发布该应用程序,我只是通过命令行构建并签署了该应用程序,然后将其上传到Google Developer Console.

To publish the app i was simply building and signing the app through the command line and then upload it in the Google Developer Console.

对于新版本,我只是在创建apk之前更新config.xml中的版本号.

For a new version i was simply updating the version number in the config.xml before creating the apk.

APP版本:

旧版本:(状态已在Google Play上发布)1.1.7代码版本:101078

Old version: (status published on Google Play) 1.1.7 Code version: 101078

新版本:(试图上传到Google Play)1.1.10

New version: (trying to upload on Google Play) 1.1.10

要解决的尝试:

我尝试将代码版本手动设置为更高的编号.目前,我在./config.xml中有此设置:

I have tried to manually set the Code version to higher number. At the moment i have this settings in the ./config.xml:

<widget id="com.myapp.myapp" version="1.1.10" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

在文件./platforms/android/AndroidManifest.xml中,我手动将设置更改为:

In the file ./platforms/android/AndroidManifest.xml I manually change the settings to:

<manifest android:hardwareAccelerated="true" android:versionCode="101079" android:versionName="1.1.10" package="com.meetinghand.meetinghand" xmlns:android="http://schemas.android.com/apk/res/android">

但是在我运行 cordova build --release android 之后,该值会自动重置为android:versionCode ="10110" ...

But after i run cordova build --release android that value is automatically reset to android:versionCode="10110" ...

运行APT:

在apk文件上运行sdk工具aapt,我得到以下信息:

Running the sdk tool aapt on the apk file i get the following:

name ='com.myapp.myapp'versionCode ='101078'versionName ='1.1.7'platformBuildVersionName ='6.0-2704002'sdkVersion:"16"targetSdkVersion:"22"

name='com.myapp.myapp' versionCode='101078' versionName='1.1.7' platformBuildVersionName='6.0-2704002' sdkVersion:'16' targetSdkVersion:'22'

问题:

这是怎么回事?

versionCode究竟设置了什么?我可以硬编码吗?为什么不管我做什么,versionCode仍保留在101078?

How exactly is the versionCode set? Can I hardcode it? Why, no matter what I do, does the versionCode remain at 101078?

为什么config.xml中明确指出了versionName 1.1.7而不是1.1.10?

Why is versionName 1.1.7 and not 1.1.10 as it is clearly stated in the config.xml?

我不知道还能做什么.

如果您解决了这个难题,我将以您的名义建造一座雕塑!

If you solve this riddle I will build a sculpture in your honor!

谢谢!

最后,我决定卸载CrossWalk,因为它并不需要严格的好处.这样,问题就解决了,我可以上传新版本了.

In the end i decided to uninstall CrossWalk because didn't strictly need its benefits. In this way the issue was resolved and I could upload the new version.

我确实可以按照@ e666指出的那样在config.xml中对代码版本进行硬编码:

I could indeed hardcode the code version inside the config.xml as pointed out by @e666:

<widget android-versionCode="101079" id="com.myapp.myapp" version="1.1.10" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

Crosswalk并没有覆盖versionCode,但将其正确设置为101079,这样我就可以将apk上传为新版本.

The versionCode was not overwritten by Crosswalk but was properly set as 101079 and in this way i could upload the apk as new version.

如果您仍然想保留Crosswalk并上传新版本,可以通过在Google Developer Console中切换到高级模式"来实现.请记住,人行横道将导出两个apk(armv7和x86),并且您需要同时上传两个.

If you still want to keep Crosswalk and upload the new version you can do it by switching to Advanced Mode in the Google Developer Console. Keep in mind the Crosswalk will export two apk (armv7 and x86) and you will need to upload both.

有关如何做的更多参考,您可以查看以下答案:

For more reference about how to do you may check out this answer:

此Google Play APK发布了什么错误消息是什么意思?

推荐答案

cordova在 AndroidManifest.xml 上覆盖您的更改是正常的,正确的解决方案是将版本放入 config.xml .

It is normal that cordova is overriding your changes on AndroidManifest.xml The proper solution is to put the version in config.xml.

如果您未明确指定versionCode,则从cordova文档中,将基于版本计算版本代码.将会是:

From cordova docs, the version code is calculated based on the version if you don't specify a versionCode explicitely. It will be :

versionCode = MAJOR * 10000 + MINOR * 100 + PATCH

所以 android:versionCode ="10110" 是正常的.

您可以使用 android-versionCode

此外,如果未更新平台文件夹,则应尝试对其进行清理.也许您看到的是apk的旧版本.

Also you should try to clean all your platform folder if it is not updating it. Maybe what you are seeing is an old version of your apk.

我忘记了:这是科尔多瓦文档的链接: https://cordova.apache.org/docs/en/6.x/guide/platforms/android/index.html#setting-the-version-code

I forgot : here is the link to cordova docs : https://cordova.apache.org/docs/en/6.x/guide/platforms/android/index.html#setting-the-version-code

对于旧版本代码101078,也许您使用的是Crosswalk之类的插件.

And for the old version code 101078 maybe you were using a plugin like Crosswalk.

这篇关于上传失败:您的APK需要使用其他版本代码,因为您已经有一个使用版本代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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