This is a migrated thread and some comments may be shown as answers.

getVersionCode appends 2 to the version code using Cordova AppVersion plugin

3 Answers 50 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
ruchin
Top achievements
Rank 1
ruchin asked on 29 Feb 2016, 12:27 PM

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.

    

3 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 29 Feb 2016, 03:13 PM
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.

 
0
ruchin
Top achievements
Rank 1
answered on 02 Mar 2016, 12:47 PM

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

0
Tsvetina
Telerik team
answered on 02 Mar 2016, 02:17 PM
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.

 
Tags
General Discussion
Asked by
ruchin
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
ruchin
Top achievements
Rank 1
Share this question
or