我对游戏商店的版本号有问题。
我的应用程序的版本过去被格式化为
Version code
10172 (5 digits)
Version name
1.1.72我改变了构建机器,却没有意识到我上传的版本
Version code
101748 现在是6t数字!8将版本号扩展为太长。
Version name
1.1.74101748现在正在阻止我上传一个新版本到商店。例如,对于版本1.1.821中的config.xml,我再次得到了版本代码101748的APK!上传失败
You need to use a different version code for your APK because you already have one with version code 101748.我有其他的编译组合,版本代码又是5位数,上传失败。
我不能删除当前上传的版本从播放商店,我不知道如何调整自动构建系统的离子强制它使用特定的版本代码?在构建过程中,代码似乎是从版本中生成的。
欢迎任何建议。
发布于 2016-07-18 20:55:14
好吧,花了我一段时间,但要解决这个问题必须分开
cordova build --release android 转到
cordova prepare android
./adjustVersionCode.py
cordova compile android --release在未优化和清理的python中使用adjustVersionCode.py:
#!/usr/bin/env python
from lxml import etree
lines = ''
with open('config.xml','r') as configFile:
for line in configFile.readlines():
lines += line
configXML = etree.fromstring(lines)
versionNumber = configXML.attrib['version']
versionCode = versionNumber.replace('.','')
if len(versionCode) < 6:
versionCode += '0'
print versionNumber,versionCode
lines = ''
with open('./platforms/android/AndroidManifest.xml','r') as configFile:
for line in configFile.readlines():
lines += line
androidManifestXML = etree.fromstring(lines)
wrongVersion = androidManifestXML.attrib['{http://schemas.android.com/apk/res/android}versionCode']
replaceString = 'android:versionCode="'+str(wrongVersion)+'"'
replaceWith = 'android:versionCode="'+str(versionCode)+'"'
lines = ''
with open('./platforms/android/AndroidManifest.xml','r') as configFile:
for line in configFile.readlines():
lines += line.replace(replaceString,replaceWith)
with open('./platforms/android/AndroidManifest.xml','w') as configFile:
for line in lines:
configFile.write(line)发布于 2016-07-31 09:24:45
作为解决办法,编辑您的config.xml,添加“android”并手动指定versionCode:
widget id="com.xxxxx.yyyyyyyyyyy" android-versionCode="201018"
version="2.1.1"发布于 2016-07-25 18:26:21
请参阅"building with cordova for android creates wrong version code"
但是,由于您在商店中的当前版本是101748,为了上传一个新版本,您需要至少是101749。谷歌上没有办法撤销这一点,所以你只需要从这个号码开始,或者上传成一个全新的应用程序。
https://stackoverflow.com/questions/38042590
复制相似问题