19

I'm going to update my apk on GooglePlay Store and I know that i have to upgrade the version code and name in manifest file however, it made install_failed.

Installation error: INSTALL_FAILED_VERSION_DOWNGRADE 

Please check logcat output for more details. Launch canceled!

I modified the version code and name like this: android:versionCode="2" android:versionName="1.0.5"

Did i make it wrong?

IntelliJ Amiya
  • 70,230
  • 14
  • 154
  • 181
user3503072
  • 307
  • 1
  • 2
  • 9

11 Answers11

38

Just uninstall the application on your device first and then install the fresh one.

Martin
  • 577
  • 1
  • 6
  • 8
28

When you are installing via adb you can pass -d to allow version downgrade

adb install -d -r your.apk

-r will also replace the existing app

Rohit Poudel
  • 1,604
  • 2
  • 16
  • 19
kemuri
  • 298
  • 3
  • 8
  • 6
    Since Android 7 (Nougat), [for security reasons](https://android.googlesource.com/platform/frameworks/base/+/921dd75), `adb install -d` no longer works unless the package is marked as debuggable. – xhienne Jun 05 '18 at 13:45
8
Installation error: INSTALL_FAILED_VERSION_DOWNGRADE Please check logcat output for more details. Launch canceled!

I solved it by using the command prompt,navigating to project folder >adb uninstall package (you can get the package from Manifest.xml file).

In my case : D:\projectFolder\AndriodApp>adb uninstall com.example.app

Again launch the App in emulator or mobile.

Tim
  • 38,263
  • 17
  • 115
  • 131
5

just use this:

$ adb -e uninstall your.application.package.name

Karl Lu
  • 51
  • 1
  • 2
4

Apparently the versionCode of your currently installed version of the application is greater than 2, thus resulting in a failed installation on the device.

keyboardsurfer
  • 14,541
  • 6
  • 59
  • 82
  • I made the version code to "105" however i got a dialog "Error, please restart application error code : 20 " on my device. I can't find error on Logcat. Do you have any idea with it? I have no clue. – user3503072 Jul 03 '14 at 09:00
3

This happen when your installed apk version less than version by which you are trying to build apk. For example you just upgrade your version and try to build apk with it but you already a installed apk in your device which was build by the previous one.

In this case you must uninstall the previous apk and build a new one with the exiting version.

Yusuf
  • 585
  • 7
  • 10
2

I just disabled it first in setting>apps>allapps>app and I was able to install using regular command: adb -r name.apk

1

First thing you need to do is check versionCode and versionName for palystore apk and then increment number by one for both versionCode and versionName.

for instance:in playstore versionCode="42"and versionName="1.4.2" then change it versionCode="43" and versionName="1.4.3" in your latest code

Ajay Takur
  • 5,287
  • 4
  • 31
  • 50
  • Great, but exactly *where* is that versionCode to be found? – andreszs Jul 31 '16 at 20:19
  • 1
    1)Programmatically by manifest file to increment versions. 2)Earlier versions in production go http://stackoverflow.com/questions/14470402/query-the-google-play-store-for-the-version-of-an-app – Ajay Takur Aug 01 '16 at 06:46
0

Ajay Takur is correct. Your App's current version code should be greater than the playstore one.

But do refer to this answer once. It may solve your problem.

Community
  • 1
  • 1
Atul Panda
  • 307
  • 5
  • 19
0

In my case, I had to remove and uninstall the version on the device and then running the project. It reinstalled the version in the IDE and it worked like a charm.

Krishna Vedula
  • 1,188
  • 20
  • 24
0

Another take on the same error message: in Android Studio (unlike Eclipse), the version code/name are listed in the gradle file. If they're present both there and in the manifest, the gradle ones take precedence.

Seva Alekseyev
  • 55,897
  • 22
  • 151
  • 252