Pavan Kumar Pavan Kumar - 1 month ago 24
Android Question

Meteor.js android version code

In the mobile-config.js I have specified following

App.info({
.....
version: '1.0.8',
....
});


App.setPreference('android-versionCode', '9');


Accordingly when I build apk it should have versionCode set to 9 and version name to "1.0.8', but in my case versionCode is being set to "10008" while version name is correctly shown as "1.0.8".

Is there something wrong in my config? Is there different method to version Code?

Answer

You can override meteor build files and setting by creating a top level folder called /cordova-build-override/, read more here errr, GitHub is down, I will post a link when it is back.

Solution is to pass Android build settings to build-extras.gradle. You can read more here Android Shell Tool Guide.

Create /cordova-build-override/platforms/android/build-extras.gradle. The Android Version Name will be set in mobile-config.js but the Version Number (Integer) will be set by this gradle file.

cdvVersionCode = '10'
android {
  lintOptions {
      disable 'MissingTranslation'
      disable 'ExtraTranslation'
  }
}