It seems like the most recent Android 4.2 has introduced this error condition on installation when one attempts to install an APK with a lower version. In prior versions of Android, one would be able to install older APK's simply via adb install -r <link to APK>
. For debugging purposes, I frequently need to re-test older APK's; and the -r
flag would replace the older build in older Android versions. Is there a work-around here to ignore [INSTALL_FAILED_VERSION_DOWNGRADE]
?
-
1You mean, besides uninstalling the newer version? – CommonsWare Nov 15 '12 at 17:21
-
1Correct; I assumed the `-r` flag would handle this. – AaronMT Nov 15 '12 at 17:30
-
5This question also valid for cases where you have (somewhat incorrectly) misnumbered builds. E.g. maybe your v1.0 from a dev box has a higher versionCode than v2.0 from a build server. – parkerfath Mar 18 '14 at 00:59
13 Answers
It appears the latest version of adb tools has an "allow downgrade flag" that isn't shown in the adb help, but it is shown in the "pm" help on the device. So use:
adb install -r -d <link to apk>

- 3,465
- 1
- 14
- 9
-
6Tried with `adb install -rd
` which didn't work. Your versino (with options separated) works fine. Thanks! – MarSoft Nov 22 '15 at 22:05 -
1And it seems to be documented now! Just not that you have to use -r -d, -rd will not work – plaisthos Jan 08 '16 at 12:44
-
For example, to uninstall (downgrade) Waze 4.0.0.2 and install version 3.9.5.3: **adb install -r -d Waze_3.9.5.3.apk**. This way you won't lose app data. – Derek Gogol Mar 14 '16 at 19:06
-
22Since Android 7 (Nougat), adb install -d no longer works unless the package is marked as debuggable. https://android.googlesource.com/platform/frameworks/base/+/921dd75 – Darpan Jun 18 '18 at 10:28
-
7
-
1@Darpan So for signed APKs, it's impossible to install older versions on top of new ones, right? – android developer Mar 01 '21 at 09:03
-
@Darpan Interestingly, GrapheneOS allowed me to do `-r -d` with a signed APK from F-Droid. – Martin Braun Jun 06 '23 at 01:05
You can try and use adb uninstall -k <package>
and then installing the older apk.
From the adb usage guide:
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
I've tried it myself with my apk, and it seems to work for most of the data (some data like RawContacts was not saved)

- 1,299
- 9
- 18
-
1It appears that this command does not actually execute the uninstall, instead simply yielding a warning. The command to actually excecute this appears to be `adb shell pm uninstall -k
`. – Paul Lammertsma Dec 23 '13 at 13:40 -
This is also useful for downgrading, if adb -d still complains as it did for me. – Pointer Null Apr 09 '15 at 21:45
Did you enabled Multiple account on your device (and push your apk via ADB)? If so you have to remove the apk in every account. After complete uninstall, your push will be OK.

- 308
- 1
- 4
-
Restoring backup via Titanium Backup did not work. Fresh install did not work. Installing via APK and/or adb install did not work. This cost me 1,5h and your simple tip did the trick. Thanks! – bentolor Sep 17 '17 at 09:02
-
1This helped in the following situation: I uninstalled an app and restored an older version with Titanium Backup. After an automatic app update I tried to downgrade again with TB > hung up on restore; tried installing the APK manually > didn't work with the error "App not installed". So my take away is that TB falesly seems to install apps globally for all users. Samsung S9, Android 9. – sir_brickalot Sep 06 '20 at 12:54
For me, only this works fine, because my app is a system app.
adb install -t -r -d myapp.apk

- 16,247
- 7
- 61
- 84
In my case it was a stale version of Google Play Services included with my project. I am using Android Studio. I ran an update on the SDK, and imported the updated library, and that error went away. So my suggestion: update to the latest libraries that are referenced by your project.

- 26,189
- 23
- 116
- 147
I also faced the same problem.It can be resolved with below steps which are easier than deleting any apk from the device -
1) Run command "adb logcat | grep -i version" on the terminal
2) Look for the particular line, which will be shown at the end of the logcat -
"Downgrade detected: Update version code 5011 is older than current 9109"
3) copy the current version( for eg 9109) and paste it in AndroidManifest.xml as shown below -
android:versionCode="9109"
Now clean and rebuild the application and it should work fine.

- 1,219
- 12
- 16
-
'grep' is not recognized as an internal or external command, operable program or batch file. grep is working on Unix like OS – leonidaa Feb 04 '21 at 09:13
-
This user just shows upgrading normal app Instead of grep you can use find on windows, but it has different parametrs, example - find "version" – Tomek Aug 08 '23 at 06:58
Try uninstalling previously installed version of app using-
adb uninstall com.package.name
and then install/run your app again

- 5,194
- 2
- 28
- 33
See documentation: https://developer.android.com/studio/command-line/adb
-d: Allow version code downgrade.
Simply doing adb install -d your-app.apk
should help.

- 475
- 4
- 18
Just uninstalling the application on your device first and then installing the fresh one worked for me. Regards!
-
Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 25 '23 at 07:34
You might have installed from a separate copy of the code where the version number was higher than the copy you’re working with right now. In either case, uninstall the currently installed copy, or open up Settings > Apps to determine the version number for the installed app, and increment your versionCode to be higher in the AndroidManifest.

- 19
- 1
-
1Why was this downvoted? It may not be the best answer, but it seems like a viable solution (and perhaps the easiest) for someone who is new to this! *Please* leave comments for answers like this, as they are *essential* not only for the answerer, but for the readers who visit this question later. :-| – Jan 08 '14 at 02:21
-
This is of course something that can be done. It is obvious already. The question is asking if there is a way to skip this check and allow downgrade. And the answer is yes. This answer basically says no. – tasomaniac Jan 11 '17 at 08:59
It may be a problem with the Google Play Services dependencies.
Sometimes, it is NOT the case that:
a) there is an existing version of the app installed, newer or not
b) there is an existing version of the app installed on another user account on the device
So the error message is just bogus.
In my case, I had:
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-gcm:16.0.0'
But when I tried
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.gms:play-services-gcm:17.0.0'
I got androidX related errors, as I had not yet upgraded to androidX and was not ready to do so. I found that using the latest 16.x.y versions work and I don't get the error message any more. Furthermore, I could wait till later when I am ready, to upgrade to androidX.
implementation 'com.google.android.gms:play-services-maps:16.+'
implementation 'com.google.android.gms:play-services-location:16.+'
implementation 'com.google.android.gms:play-services-gcm:16.+'

- 3,902
- 1
- 44
- 58
Uninstall existing installed app.
check if you have changed project package name , Because of package name , It gets conflicts with existing app.

- 119
- 1
- 3
For people facing issues with Xiaomi:
adb shell pm uninstall <package_name>

- 250
- 4
- 11
-
This doesn't help with anything and should be explained why it need to done this way. – Benyamin Limanto Apr 21 '20 at 13:22