ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

Android error: INSTALL_FAILED_VERSION_DOWNGRADE

Open mhartington opened this issue 11 years ago โ€ข 8 comments

If you have a version of an app on the device already, and there is a difference in the versions, ant/android gives a pretty cryptic error.

Installing app on device...

/Users/mhartington/GithubRepos/ionic/tmp/platforms/android/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
ERROR: Failed to launch application on device: ERROR: Failed to install apk to device:  pkg: /data/local/tmp/CordovaApp-debug.apk
Failure [INSTALL_FAILED_VERSION_DOWNGRADE]

ERROR running one or more of the platforms: Error: /Users/mhartington/GithubRepos/ionic/tmp/platforms/android/cordova/run: Command failed with exit code 8
You may not have the required environment or OS to run this project

We should try to catch this error and provide a better message for why it failed.

mhartington avatar Mar 02 '15 15:03 mhartington

It looks like this issue comes from having a previously installed version, according to this issue on stack overflow

The answer seems to be running adb uninstall com.package.name - we should have ionic run this just incase the error pops ups.

jbavari avatar Mar 02 '15 18:03 jbavari

Confirmed, this is the issue and the solution. I've just created a simple shell script that does exactly this: adb uninstall <packagename> ionic run android until this will be incorporated in Ionic. uninstalling a package that doesn't exist should fail silently and it does, so that's great.

michahell avatar Mar 08 '15 20:03 michahell

The solution works perfectly fine when I use ionic run android and runs with no errors on my device. But when I build it and get the .apk file and install it, the app stops working after showing the splash screen. Here is the detail: http://forum.ionicframework.com/t/blank-white-screen-android-apk/30300

technotip avatar Aug 11 '15 12:08 technotip

Can't FB not just use meaningful error codes? NEW_VERSION_OLDER_THAN_INSTALLED would be infinitely clearer than INSTALL_FAILED_VERSION_DOWNGRADE which describes, and requires prior knowledge of, some internal process rather than what the error is to the end developer.

PhpGuyZim avatar Sep 17 '17 11:09 PhpGuyZim

I'm not sure it matters if the version is actually newer or not. I get the same error message if I download my app from the playstore (v 3.5.2) and then try and install over the top of it my latest apk (3.5.4).

Though this may also have something to do with the version codes? Since I've noticed when uploaded multiple architecture builds to the play console the version codes are quite different (like 4195757)

Aequitas737 avatar Oct 15 '19 23:10 Aequitas737

adb uninstall <package-name> worked for me

kuttikrishnankodoth avatar Jul 30 '20 15:07 kuttikrishnankodoth

How to solve the problem

pm894037 avatar Mar 05 '26 08:03 pm894037

[๐Ÿš€] Downgrade: com.bbk.theme [๐Ÿงน] Uninstalling existing... [๐Ÿ“ฆ] Installing... Failure [INSTALL_FAILED_VERSION_DOWNGRADE: Package Verification Result] [โŒ] Installation failed!

How to solve the issue??

pm894037 avatar Mar 05 '26 08:03 pm894037