Why does Cordova/Phonegap append 8 to my Android Version Code?

后端 未结 4 1963
北海茫月
北海茫月 2020-12-15 16:08

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

4条回答
  •  余生分开走
    2020-12-15 16:31

    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!

提交回复
热议问题