Giter Club home page Giter Club logo

Comments (9)

vaenow avatar vaenow commented on July 2, 2024 2

If you always got "8" in the end, you can try this rule in your version.xml below:

versionName versionCode
0.0.1 18
0.3.4 3048
3.2.4 302048
12.234.221 1436218
<update>
    <version>302048</version>
    <name>name</name>
    <url>http://192.168.0.1/android.apk</url>
</update>

Note the end of 8 number

from cordova-plugin-app-update.

Shepless avatar Shepless commented on July 2, 2024 1

@vaenow Sorry but I still do not understand the suffix of number 8 to the version? Also I do not understand why:

12.234.221 === 1436218

Can you explain to me please? I have read comment above but I still do not understand?

from cordova-plugin-app-update.

wzcrystal avatar wzcrystal commented on July 2, 2024

yes,I also take this way,but I want to know why does this happen, do you know?

from cordova-plugin-app-update.

vaenow avatar vaenow commented on July 2, 2024

Cheers! 🍻 I got the answer when I just almost say sorry to you.

FILE: platforms/android/build.grade

if (Boolean.valueOf(cdvBuildMultipleApks)) {
  ///......
} else if (!cdvVersionCode) {
  def minSdkVersion = cdvMinSdkVersion ? : privateHelpers.extractIntFromManifest("minSdkVersion")
    // Vary versionCode by the two most common API levels:
    // 14 is ICS, which is the lowest API level for many apps.
    // 20 is Lollipop, which is the lowest API level for the updatable system webview.
  if (minSdkVersion >= 20) {
    defaultConfig.versionCode += 9
  } else if (minSdkVersion >= 14) {
    //Your "minSdkVersion" must be equal or larger than 14
    defaultConfig.versionCode += 8 
  }
}

FILE: platforms/android/AndroidManifest.xml

You may have the line:

<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="22" />

I created an new Cordova project and it passed my test 🎅

from cordova-plugin-app-update.

garyganyang avatar garyganyang commented on July 2, 2024

why does it have such a rule?

from cordova-plugin-app-update.

tda7088 avatar tda7088 commented on July 2, 2024

Modify 8 in the end,it is ok,thanks very much

from cordova-plugin-app-update.

vaenow avatar vaenow commented on July 2, 2024

@garyganyang I have explained the rule 😃 above.

please let me know if you have any further questions.

from cordova-plugin-app-update.

vaenow avatar vaenow commented on July 2, 2024

@tda7088 🔆

from cordova-plugin-app-update.

vaenow avatar vaenow commented on July 2, 2024

Cordova official version-code rule:

https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#setting-the-version-code

from cordova-plugin-app-update.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.