Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please increase versionCode with each release #6

Closed
IzzySoft opened this issue Nov 20, 2020 · 8 comments
Closed

please increase versionCode with each release #6

IzzySoft opened this issue Nov 20, 2020 · 8 comments

Comments

@IzzySoft
Copy link
Contributor

For several versions now (since v1.0.1), versionCode is stuck on "2". Please remember increasing this whenever you make a new release – else existing users won't ever receive updates, as Android considers the releases being "identical".

I don't know where you specify that, as details in your repo here are contradicting each other:

  • pubspec.yaml says version: 1.0.2+2 – but versionName in the APK is 1.0.3
  • app/build.gradle claims to get the versions from Flutter, and thus gives no details itself (no idea where Flutter takes them from, I'm no dev)
  • AndroidManifest.xml gives no clue

Could it be you override these values at build time, using command line parameters like --build-name and --build-number? In any case, you might wish to check with eg. How to set build and version number of Flutter app at StackOverflow, which discusses how to do it, what might go wrong and why.

@monolidth
Copy link
Member

Thanks for your explanation. I really thought that this it is enough to change the versionName. I correct this issue and rebuild the application.

Regards,
William

@monolidth
Copy link
Member

I now compiled the binary again and update the released.

@IzzySoft
Copy link
Contributor Author

Thanks! But that was the wrong direction:

package: name='org.receipt_manager' versionCode='1' versionName='1.0.3' compileSdkVersion='29' compileSdkVersionCodename='10'

versionCode should have been "3" or higher. Now it's even DEcreased again – so Android will refuse to install it over an existing "2" even when explicitly told to.

Let me give some additional explanation on the two:

  • versionName: this is what is shown to the users, so it should be easily readable and make it easy to see which one is newer. You already meet this, even using semantic versioning (major.minor.patch) – which is great!
  • versionCode: used internally by Android to determine which version is "greater":
    • old = new: this is the same version, no action required (but user can do e.g. adb install -r *.apk successfully)
    • old < new: inform the user about update (or update automatically, depending on client setup). Of course adb install -r *.apk would work as well.
    • old > new: the "new" version is older. Do NOT inform user, do NOT upgrade, refuse to accept adb install -r *.apk giving an error message (this is the state we have now with the current 1.0.3 – which is bad.)

So please do always INCREASE versionCode with each new release. At least +1 – but in the end, increasing by ANY value would work – it's just important versionCode of the new release is higher than any versionCode used before.

@monolidth
Copy link
Member

Thanks for the information you provides.Fail, I thought that the versionCode is an revison id for every versionName. This is fixed at be58bd7.

Regards
William

@IzzySoft
Copy link
Contributor Author

Hehe… Yeah, some things are rather complex. Took me a while, too, to grasp all those connections and relations. Still have gaps in my understanding of things. Learning is never "done with", it's a continuous process…

Glad I was able to help out with the little I've learned meanwhile! Looking forward to the next release then – which should go smoothly now 😃 Thanks for your patience!

Besides, should you have replaced the APK at the release, please let me know; I should then manually replace it at my end, too, so the update gets signaled to users of previous versions. OTOH, if you've planned a release for the next day, we also could simply wait until that got pulled.

@monolidth
Copy link
Member

Yeah, now I updated the current apk binary. Thanks for pointing this issue.

Regards,
William

@IzzySoft
Copy link
Contributor Author

Thanks a lot! I just pulled it. Will replace the "current" one with the next sync in about an hour – and this time will be announced to all current users as "update available!" – even to those already running the "previous" 1.0.3+2 😃

Now, looking forwards to 1.0.4+21 😄

@monolidth
Copy link
Member

I really appreciate the input. Even if I do stupid mistakes. Hope, that there is soon a new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants