9

I am trying to install a modified apk file onto my Nook Simple Touch. I modified the Reader.apk program, recompiled it, and signed it with my own key.

I know that you cannot install an app over a current app if the signing keys are different. However, I am getting the error INSTALL_FAILED_UPDATE_INCOMPATIBLE even after completely uninstalling the original Reader.apk app.

After checking the packages.xml file, I removed the entry for the old Reader.apk app. And I am still getting this error. The app is completely uninstalled, and I cannot install my modified version.

Even signing the original sources with my new key causes this error to come up (so it has nothing to do with the actual changes I made).

Stephen S
  • 356
  • 1
  • 5
  • 16
  • Initially, I couldn't find my uninstalled app under Settings -> Apps. It turned out that in Lollipop 5.1.1, the uninstalled app was listed by the package name, not the app name. So, if you did an adb uninstall, and adb install still fails, look for your uninstalled app under your package name. So, com.acme.wileycoyote will be listed alphabetically under "c", not "w". – Yojimbo Jan 13 '16 at 17:57
  • Possible duplicate of [Failure \[INSTALL\_FAILED\_UPDATE\_INCOMPATIBLE\] even if app is not yet installed](http://stackoverflow.com/questions/26794862/failure-install-failed-update-incompatible-even-if-app-is-not-yet-installed) – Ciro Santilli OurBigBook.com Jun 22 '16 at 16:56
  • @CiroSantilli巴拿馬文件六四事件法轮功 That question was asked *after* this question. And it didn't have the same problem. The app in my question was, in fact, completely uninstalled. The solution provided in the other answer presumably wouldn't have fixed my problem. See the first comment here: http://stackoverflow.com/a/9783966/306937 – Stephen S Jun 22 '16 at 19:17
  • @StephenSchrauger consensus is that date is not the deciding factor but if you think they are different that is enough for me. – Ciro Santilli OurBigBook.com Jun 22 '16 at 20:16

3 Answers3

6

According to the docs, this error appears "if a previously installed package of the same name has a different signature than the new package (and the old package's data was not removed)."

If you're sure you removed it, there may be some spot where the old signature is still floating around that removal didn't, um, remove. Wiping the emulator/device data should clear up the problem.

ashim888
  • 206
  • 10
  • 22
  • It's a good point that I have to look around for other spots with the same signature. However, this is not an emulator, and the app in question is baked into the system image. I can, of course, modify the image, but I was still getting the same error, which is why I posted the question and my solution I found later. – Stephen S Mar 10 '14 at 13:00
  • I was running through the same problem but doing what i said made my app work, thought that might help. – ashim888 Mar 13 '14 at 10:16
  • 1
    I ran into this issue after switching computers. The app had some "ghost" files that I could not remove. The solution was to build an signed APK, install the app from memory/SD and then uninstall. Now it works fine. – BayssMekanique Jul 22 '14 at 14:36
3

If the original application was completed removed and we still having the same message:

INSTALL_FAILED_UPDATE_INCOMPATIBLE 

Go to Settings > Apps and you will find your app with the message:

"Not installed for this user"

, we have to uninstall manually for all users with the option:

"Uninstall for all users"

Jorgesys
  • 124,308
  • 23
  • 334
  • 268
2

The solution is to modify the AndroidManifest.xml file. You need to remove the sharedUserId attribute in the second line.

The Reader.apk file is a system app, and it is made by the manufacturers of the device itself, who also made several other apps. Due to this, they were able to set the sharedUserId flag, which allows all of their apps to interact with each other. As a security design, all the apps are required to have the same signing key. When I tried to install the modified app, it failed to install because it was trying to share the user id with the other apps while lacking the proper signing key.

By removing the flag in the xml, you can successfully install the modified app. Change the following line in the AndroidManifest.xml file from this:

<manifest android:sharedUserId="android.media" android:versionCode="1"
    android:versionName="1.0" package="com.bn.nook.reader.activities"
    xmlns:android="http://schemas.android.com/apk/res/android">

to this:

<manifest android:versionCode="1" android:versionName="1.0"
    package="com.bn.nook.reader.activities"
    xmlns:android="http://schemas.android.com/apk/res/android">`

See this xda post for more details. (Full Disclosure: I wrote that post.)

ArtKorchagin
  • 4,801
  • 13
  • 42
  • 58
Stephen S
  • 356
  • 1
  • 5
  • 16
  • This answer didn't worked for me so just linking the working answers on SO 1. http://stackoverflow.com/questions/26794862/failure-install-failed-update-incompatible 2. http://stackoverflow.com/questions/11891848/install-failed-update-incompatible-when-i-try-to-install-compiled-trebuchet-apk – surhidamatya Apr 13 '15 at 05:28