Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Device already has a newer version" error

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?

like image 891
TKoL Avatar asked May 09 '26 15:05

TKoL


1 Answers

Try to delete the build folders and then clean build your app

like image 138
Sahil Avatar answered May 12 '26 06:05

Sahil



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!