Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 849
Pavan Kumar Avatar asked Aug 24 '15 10:08

Pavan Kumar


Video Answer


2 Answers

As of Meteor 1.4.2 you can specify buildNumber in App.info within the mobile-config.js file. See example below

App.info({ id: '', name: '', description: '', version: '0.5.6', buildNumber: '5060', author: '', email: '', website: '' });

like image 166
sathish Avatar answered Sep 27 '22 18:09

sathish


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'
  }
}
like image 28
benstr Avatar answered Sep 27 '22 18:09

benstr