[java] Android Emulator: Installation error: INSTALL_FAILED_VERSION_DOWNGRADE

I am currently trying to compile and test a small Android Application.

I am using Eclipse, and have SDK 4.2 (Api Level 17) installed. I've set

<uses-sdk android:targetSdkVersion="17" android:minSdkVersion="8" />

although I've tried also different values (i.e. 17/17).

I do not use any GoogleAPI functions, nor do I use functions that are not available in API Level 8. Or at least I do not get any compile errors or warnings in that regard.

When I compile the project and run it on a real device running Android 2.2.1 the Application runs fine. However when I try to run the application on an emulator (Android Virtual Device) with Android 4.2, Api Level 17 I get the following error:

[2012-12-10 21:10:29 - SoftKeyboard] Installation error: INSTALL_FAILED_VERSION_DOWNGRADE
[2012-12-10 21:10:29 - SoftKeyboard] Please check logcat output for more details.
[2012-12-10 21:10:29 - SoftKeyboard] Launch canceled!

Logcat however is empty. I have really no clue, what this error even means...

This question is related to java android sdk

The answer is


this happened to me when I imported an Android Studio App into eclipse.

I figured out the andoridmanifest.xml file needs to be slightly modified when importing from android studio project. I created a new test project, and copied over the headings to make it match. voila, issue solved.


This error appears in my android project with multiple kind of gfx files. At the end no change in the manifest file was accepted.

Because my lack of knowledge about the android devices I forget that my test device has a second User. This User also has an installed version of my app so I also have to delete the app for this user account and it works.


In Marshmallow, I got this error,

Installation error: INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE
Please check logcat output for more details.
Launch canceled!

Looking for solution I searched and came here. I deleted the app but still have this problem in Nexus 6. Later found that in,

Settings > Apps > [My app name] have to removed for all user. 

I was having same problem. I was getting error when i tried to run in my android device not emulator.

sudo ionic run android 

I am able to fix this by running

adb uninstall com.mypackage.name

Just uninstall the previous Apk and install the updated APK


It may be a problem with the Google Play Services dependencies rather than an actual app version issue.

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.+'

You can also consider adding -d flag to adb install. It should ignore this error.

adb install -r -d abc.apk

the thing that kept on killing me was that i didn't know that this app was installed for my guest account (although I had uninstalled it for the other accounts..)

so i searched for the app in the app manager, and simply clicked on uninstall for all users

enter image description here


INSTALL_FAILED_VERSION_DOWNGRADE

All Android apps have a package name. The package name uniquely identifies the app on the device. If same packageName as app that's already installed on the device then this error Showing .

  1. You can uninstall the application from your device first and then install the fresh one .
  2. You could simply increase the number by one each time a new version is released.

I was having the same problem. I installed with

    adb shell pm install --user <userId> test.apk

For some reason, there was no icon on the screen. It was a debug build and all other consecutive installs were not working. Simply uninstalling the package helped.

     adb uninstall com.package.name

you can try this: adb install -r -d -f your_Apk_path


First uninstall your application from the emulator:

adb -e uninstall your.application.package.name

Then try to install the application again.


This was happening in my project because I was using an XML resource to set the version code.

AndroidManifest.xml:
android:versionCode="@integer/app_version_code"

app.xml:
<integer name="app_version_code">64</integer>

This wasn't a problem in prior versions of adb, however, as of platform-tools r16 this is no longer being resolved to the proper integer. You can either force the re-install using adb -r or avoid the issue entirely by using a literal in the manifest:

android:versionCode="64"

According to sdk src code from ...\android-22\android\content\pm\PackageManager.java

/**
 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
 * the new package has an older version code than the currently installed package.
 * @hide
 */
public static final int INSTALL_FAILED_VERSION_DOWNGRADE = -25;

if the new package has an older version code than the currently installed package.


This can happen when trying to install a debug/unsigned APK on top of a signed release APK from the Play store.

H:\>adb install -r "Signed.apk"
2909 KB/s (220439 bytes in 0.074s)
        pkg: /data/local/tmp/Signed.apk
Success

H:\>adb install -r "AppName.apk"
2753 KB/s (219954 bytes in 0.078s)
        pkg: /data/local/tmp/AppName.apk
Failure [INSTALL_FAILED_VERSION_DOWNGRADE]

The solution to this is to uninstall and then reinstall or re run it from the IDE.


Examples related to java

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How much should a function trust another function How to implement a simple scenario the OO way Two constructors How do I get some variable from another class in Java? this in equals method How to split a string in two and store it in a field How to do perspective fixing? String index out of range: 4 My eclipse won't open, i download the bundle pack it keeps saying error log

Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to sdk

I am receiving warning in Facebook Application using PHP SDK Has been compiled by a more recent version of the Java Runtime (class file version 57.0) Difference between OpenJDK and Adoptium/AdoptOpenJDK Error:Failed to open zip file. Gradle's dependency cache may be corrupt Can't accept license agreement Android SDK Platform 24 Automatically accept all SDK licences Android SDK location should not contain whitespace, as this cause problems with NDK tools Android SDK folder taking a lot of disk space. Do we need to keep all of the System Images? "The following SDK components were not installed: sys-img-x86-addon-google_apis-google-22 and addon-google_apis-google-22" Can't find SDK folder inside Android studio path, and SDK manager not opening