Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ionic build number wrong in config.xml file

My problem is that if I compile my project, it adds a 2 to the build number.

My Ionic config.xml

<widget id="at.company.or.so" version="0.0.1" ios-CFBundleVersion="55" android-versionCode="72" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

My AndroidManifest.xml

<manifest android:hardwareAccelerated="true" android:versionCode="72" android:versionName="0.0.1" package="at.tiddlr.app" xmlns:android="http://schemas.android.com/apk/res/android">

If i build a debug or release Version should be 0.0.1(72) but when i install the App it is 0.0.1(722)

Output of aapt aapt d badging apk.apk

package: name='at.company.or.so' versionCode='722' 
versionName='0.0.1'platformBuild
VersionName='5.1.1-1819727'
sdkVersion:'14'
targetSdkVersion:'22'

I think it's a problem while compiling but i have no idea where to search.

like image 589
Mazz Avatar asked Aug 14 '15 10:08

Mazz


1 Answers

Not sure if you still have an issue with this, but I ran into the same build issue with Android where mine would increment with an 8. My solution for now is to..... dramatic pause.... comment out some lines in the build.gradle file. Whenever I upgrade the CLI I have to go do it again....

This line:

versionCode cdvVersionCode ?: Integer.parseInt("" + privateHelpers.extractIntFromManifest("versionCode") + "0")

Change to:

versionCode cdvVersionCode ?: Integer.parseInt("" + privateHelpers.extractIntFromManifest("versionCode"))

Then I also comment out the whole if/else block about 13 lines down which starts with:

if (Boolean.valueOf(cdvBuildMultipleApks)) {

Now I have to manually update my build number for android before I deploy to the store in the config file, but my increment issue has stopped. Hopefully this help somebody out if you have already passed the issue. I have included a link to the issue on Apache's issues board below. IF the link ever dies check out CB-8976 on Apache's issue site. I will also note that I have not experienced any issues with commenting this out... but I can not guarantee since you should not mess with this file technically as they state // GENERATED FILE! DO NOT EDIT!)

Apache Issue's / Version Code

like image 182
DigitalMystery Avatar answered Sep 29 '22 05:09

DigitalMystery