why won't the new version of my android app apk install over the old version

10,831

Solution 1

First, try installing you application using adb:

adb install -r /path/to/your.apk

If that does not help, try:

adb shell pm uninstall -k com.your.package
adb install /path/to/your.apk

This uninstall the apk, while keeping all its data. And then reinstalls it once again. If this also doesn't help, adb will at least give you error code which is much easier to troubleshoot with.

Solution 2

if the key signing is different then you can have that problem

Solution 3

While the OP has already mentioned they were setting android:versionCode higher than the previous build, and so this answer won't solve their specific problem, I have found in my case the answer was to increase android:versionCode to be higher than the installed version. Only figured this out after finding this question/

Share:
10,831
Finglish
Author by

Finglish

Updated on June 04, 2022

Comments

  • Finglish
    Finglish almost 2 years

    I successfully produced a small private android app (using appcelerator if that makes a difference) and installed it on my device from the signed apk file.

    I then made some changes to my application and repackaged it with an updated version number but signed with the same certificate and that when I ran into my problem.

    When I try to install this on my android device, as expected it warns me that "The application you are installing will replace another application" but "All previous application data will be saved". I agree to the replacement and the install goes ahead with out an error until it gets the and says "Application not installed", without any other details.

    The version code and name in the original apk are:

    android:versionCode="1" android:versionName="1.0"

    and in the second version

    android:versionCode="2" android:versionName="1.1"

    I am being driven mad by this, what am I missing?

  • Finglish
    Finglish over 12 years
    Not sure why but installing the first package via adb again did the trick, now the new versions install correctly over the top of the original