Please help, I tried mostly everything I could find.
I somehow managed to make the the automated build uploaded a app version with 6 digits to the play store a while ago. I didn’t realize it the version code was 6 digits and approved it.
However, seems the default code length is 5 digits. The old version is now too large and I can not top it with my builds. They always end up to be 5 digits and hence too small numbers.
The main problem is that one can’t delete an uploaded & released version from the store.
Feeling that if I do not find a reasonable solution I would have to create a new App and move users to it…
I can not find a way how to set / force the version code manually beforeor after building the APK.
Based on this I went through the build.gradle file and disabled ll 158 for instance
with adjustVersionCode.py in un-optimized and cleaned python:
#!/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)
I found this forum and almost started to think about python solution as @elduderino15 suggested, but @LAFONT solution is simpler and better.
Put android-versionCode="xxxxxx" in config.xml <widget id="com.xxxxx.yyyyyyyyyyy" android-versionCode="201010" version="2.1.1" ......>