getVersionCode appends 2 to the version code using Cordova AppVersion plugin

4 posts, 0 answers
  1. ruchin
    ruchin avatar
    33 posts
    Member since:
    Jun 2015

    Posted 29 Feb Link to this post

    Hi,

    I am making use of Cordova AppVersion plugin in my app.Using the following code appends 2 to the version code.

     cordova.getAppVersion.getVersionCode(function (version) { 
                      alert(version);
     });

    So if the version code is 10,then the alert returns 102.

    I dont know where the 2 is coming from.Can somebody tell me why the 2 is getting appended to the version code and how to fix it

    Regards,

    Ruchin Dayal.

        

  2. Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 29 Feb Link to this post

    Hello Ruchin,

    With the AppBuilder 3.0 release, we introduced Gradle for all Android builds targeting Cordova 3.7+. As a consequence, this digit is appended by Gradle to differentiate between different types of builds but could be counter intuitive. It is important to note that it happens within Cordova and there is an issue already logged about the behavior:
    Apache Cordova CB-8976 platforms/android/build.gradle modifies android versionCode

    Currently, we won't interfere with this behavior, as our modification could conflict with a solution Cordova comes up with. 

    If there are any side effects from this change that you are concerned about, please let us know so that we can discuss this further.

    Regards,
    Tsvetina
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
  3. ruchin
    ruchin avatar
    33 posts
    Member since:
    Jun 2015

    Posted 02 Mar in reply to Tsvetina Link to this post

    Hi Tsvetina,

    Thank You for your reply.Is there any workaround to prevent the 2 from getting appended to the version code?Cause every time I publish a build to the Google Play Store it appends 2.So next time when I build the app with version code 12,it will append 2 and will become 122.

    Thanks,

    Ruchin Dayal

  4. Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 02 Mar Link to this post

    Hi Ruchin,

    As previosuly mentioned, we prefer not to interfere with this logic that comes from Cordova, as future changes on their side may result in conflicts in our builds afterwards.

    Even though the version code is modified internally, it won't grow fast, since this additional digit only increases it by 10 after the first such build—once you have 112, 12 becomes 122, 13 becomes 132, etc.

    Regards,
    Tsvetina
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
Back to Top