6 Replies Latest reply on Sep 1, 2016 10:04 PM by VectorP

    android version code


      When my apk's get on Google Play - the version code is not what I listed in the config file.  They are NOT in sequence to previous version code numbers and seem to be totally random. Can you comment on what is going on?


      I do not mean the version,  I mean the version code.

        • 1. Re: android version code
          VectorP Level 4

          You're probably using the gradle build tool (or used it, then removed it).

          If so, then add a preference for 'android-versionCode' with value of your desired versioncode, which must be higher than the latest at Google.

          This preference will override the versioncode attribute in the widget element.

          • 2. Re: android version code
            frankieb65453130 Level 1

            Thanks for responding. I understand.


            No, I am not using any tools. I do everything "by hand" - everything. I put the version code in the config - and it is higher than the last that Google assigned. But when the app is published, Google has changed the code to some seemingly random number. This has occurred with every app I submitted.


            So,  you are saying that I can make it a "preference" rather than place it at the top as a widget element.


            It doesn't seem to matter what the version code is. Should I make a point to add it as a preference?  I was just wanting to have an explanation as to why this was happening and if I should make an effort to make it right. 

            • 3. Re: android version code
              VectorP Level 4

              No, I am not using any tools.

              The gadle build tool is not a tool you use, but it's a build egine that PGB applies when specified in the config. Severalk plugins require this build engine.

              The problem is, that the gradle engine modifies the versioncode as specified as attribute of the widget element. When notified, the PGB Team introduced the android-versionCode preference to overrule this gradle behaviour.


              Google has changed the code to some seemingly random number

              No, it's not Google changing that versioncode.


              Should I make a point to add it as a preference?

              If you're using the gradle engine, then yes. If you have no idea whether you use it or not, please post your full config.xml and I'll be happy to have a look.

              • 4. Re: android version code
                frankieb65453130 Level 1

                Thank you. I understand. I'm not a professional and it's hard to figure out this whole process.


                I just updated this app. I put version code 15 in the config  [ for lack of knowing what to put ]  - Google had 13 for the previous number. The updated listing is now version code 14 and version 4.0.0.


                I will include the config file here.


                <?xml version="1.0" encoding="UTF-8"?>

                <widget xmlns = "http://www.w3.org/ns/widgets"

                  xmlns:gap = "http://phonegap.com/ns/1.0"

                  id = "com.msmathmaster.tablemaster"

                  version = "4.0.0">



                <name>Table Master</name>


                <description>Table Master - Add and Multiply - provides practice on two of the most important elementary skills - the basic multiplication and addition facts. Random multiplication and addition facts are generated with multiple choice answers. The App responds with positive encouragegement and instructs the student to repeat missed facts outloud and visit the "tables." Twenty tables [addition and multiplication] are available for display. The student's score is tallied and reported with the goal of getting 10 facts correct out of 10 attempts.


                TM is one of a series offered by the Ms Math Master Elementary Number Skills project of iXoraBrown Web Design. Each app in the series emphasizes ONE skill with repetition so that the skill becomes automatic. TM is the perfect solution to provide valuable math practice when only a few minutes are available.


                TM is NOT wrapped in a "cartoon-like" environment; although elementary, it is a serious presentation of mathematics.</description>


                <author href="http://www.msmathmaster.com"


                Frankie Bailey</author>


                <platform name="android">

                <icon src="res/mipmap-hdpi/ic_launcher.png" density="hdpi" />

                <icon src="res/mipmap-mdpi/ic_launcher.png" density="mdpi" />

                <icon src="res/mipmap-xhdpi/ic_launcher.png" density="xhdpi" />

                <icon src="res/mipmap-xxhdpi/ic_launcher.png" density="xxhdpi" />

                <icon src="res/mipmap-xxxhdpi/ic_launcher.png" density="xxxhdpi" />



                <platform name="android">

                <splash src="res/mipmap-hdpi/splash480x800.png" density="port-hdpi"/>

                <splash src="res/mipmap-ldpi/splash240x320.png" density="port-ldpi"/>

                <splash src="res/mipmap-mdpi/splash320x480.png" density="port-mdpi"/><splash src="res/mipmap-xhdpi/splash640x960.png" density="port-xhdpi"/>

                <splash src="splash.png" />



                <platform name="android">

                <preference name="SplashShowOnlyFirstTime" value="false" />

                <preference name="SplashScreenDelay" value="4000" />

                <preference name="phonegap-version" value="cli-6.3.0" />

                <preference name="orientation" value="portrait" />



                <plugin name="cordova-plugin-splashscreen" source="npm" />

                <allow-navigation href="*" />



                • 5. Re: android version code
                  vangroover Adobe Employee

                  please view the latest docs here: Config.xml - Apache Cordova


                  the proper widget attribute for this is "android-versionCode" not "versionCode"


                  but be sure to view the docs for the version of cordova you are using, and of course we suggest always using the latest!

                  • 6. Re: android version code
                    VectorP Level 4

                    the proper widget attribute for this is "android-versionCode" not "versionCode"


                    Are you sure? Has that been changed, recently?

                    Afaik, it's a preference, not a widget attribute, at least in PGB.

                    The attribute is versioncode. See the PGB Docs, section Configuring.