Android Question INSTALL_FAILED_VERSION_DOWNGRADE What does this mean???

Cableguy

Expert
Licensed User
Longtime User
I know I shouldn't use the emulator, but since I don't have an Android 5.0, its the best next thing I have.
all works normal and I can even take advantage of my touch screen, BUT...
My latest compilation gives me this error at the very end, after all compilation is executed and It tries to load it onto the emulator:

Installing file to device. Error
pkg: /data/local/tmp/result_RAPID_DEBUG.apk
Failure [INSTALL_FAILED_VERSION_DOWNGRADE]

What does it mean???
 

DonManfred

Expert
Licensed User
Longtime User
What does it mean???
Android app are supposed to have an new VersionCode on each update: 1, 2, 3, and so forth...

In your case the already installed app have for example versioncode 3. But you want to install a app with versioncode 2 for example.

Just set the versioncode to a higher number than the installed app.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Thank's @DonManfred, @MikeH had explained that to me in the B4Chat...

I tought that by changing the AppLabel it would then be recognized as a different app, but I guess its the packaging and sign key that matters to that effect.

This issue was created when I ran an example I downloaded from the forum, which I suppose has a higher number than 1, which is the lowest and default value for a new project.

SO, TO ANYONE POSTING EXAMPLES IN THE FORUM? BE SURE TO SHARE #CODEVERSION:1 PROJECTS? SO THAT OTHER USERS DON'T GET FORCED TO ALWAYS START FOM A HIGHER CODEVERSION EVEN WHEN JUST MESSING AROUND SOME CODE!
 
Upvote 0

corwin42

Expert
Licensed User
Longtime User
SO, TO ANYONE POSTING EXAMPLES IN THE FORUM? BE SURE TO SHARE #CODEVERSION:1 PROJECTS? SO THAT OTHER USERS DON'T GET FORCED TO ALWAYS START FOM A HIGHER CODEVERSION EVEN WHEN JUST MESSING AROUND SOME CODE!

Not the version number is the problem. The examples should have a unique package name so they will be recognised as different apps.
 
Upvote 0

stanmiller

Active Member
Licensed User
Longtime User
You can swap out the app with an Android Debug command. I had a case where I didn't have access to the source and needed to downgrade. Plus, as I recall the app did not appear in the apps list and it was not possible to uninstall through the phone UI.

See this thread on StackOverflow.

Is there any way to ignore INSTALLED_FAILED_VERSION_DOWNGRADE ...
http://stackoverflow.com/questions/...failed-version-downgrade-on-application-insta

1. Connect your device to the PC
2. Open a CMD.EXE window
3. Enter this command

c:\> adb install -r -d <target.apk>
 
Last edited:
Upvote 0

stanmiller

Active Member
Licensed User
Longtime User
It is simpler. You can manually uninstall the current app and then install the new one.

For everyday apps you can uninstall manually.

I had a special case with an AOSP device where the app was inaccessible through the UI. The APK was there, but was not listed in Settings->Apps. And of course with AOSP there is no Play Store.

Rather than factory reset the device, I used the adb install command posted earlier to downgrade the .APK and get the embedded scanner working again.

There are occasional mentions here from developers using B4A with rugged hardware from the likes of Motorola/Zebra, Honeywell, and Intermec. Many of those devices run AOSP and may benefit from this workaround.
 
Last edited:
Upvote 0
Top