So my previous version of my app had in the gradle file
versionCode 17
versionName "0.0.28"
But I wanted to update my app to use the system in this article, like so:
def versionMajor = 0
def versionMinor = 0
def versionPatch = 29
...
versionCode versionMajor * 10000 + versionMinor * 100 + versionPatch
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
Now given the above code, you'd expect versionCode to come out as 29, but what happens is strange -- when I try to update it from version 17, it gives the error "Installation failed since the device already has a newer version of this application." BUT when I do the same as above, but just write versionCode 29, I don't get that error at all.
Why would I get that error when 29 is produced by code but not when I hardcode the number?
Try to delete the build folders and then clean build your app
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With