I am currently working on a Cordova project and had the problem that 8 was appended mysteriously to the versionCode of my project. For example: My original Version code was
The platforms\android\build.gradle script will add 4, 2, 8 or 9 to the version file dependent on targeted architecure - arm / x86 or the targeted api version of android .
I had a situation where my project had a "8" appended to the version number, and this was uploaded to the Play store. Further builds seemed to have dropped the 8, which meant I was unable to upload further updates - a cordova prepare command recreates the AndroidManifest.xml file, overriding manual changes to this.
The version issue can be addressed by creating a platforms\android\gradle.properties file with the contents cdvVersionCode=13008
Alternatively, in my case, I inserted a android-versionCode attribute into the config.xml:
The desired android version, in my case 103008 is then correctly written to the AndroidManifest.xml file used for the build.
Downside is having to manually update the android version, upside, can upload the apk!