How to fix "signatures do not match previously installed version" error?
Asked Answered
E

4

6

First, I have already uninstalled this app from my Huawei tablet device.

Now, I want to reinstall the APK with same package name using adb command line from my Mac.

./adb install ~/myapp.apk

I got this error:

Performing Streamed Install
adb: failed to install myapp.apk: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.example.myapp signatures do not match previously installed version; ignoring!]

From browsing around, I learn that perhaps the app did not uninstalled correctly. So I use adb shell.

$./adb shell

Device:/$ pm uninstall com.example.myapp
Failure [DELETE_FAILED_INTERNAL_ERROR]

Device:/$ pm uninstall --user 0 com.example.myapp
Failure [not installed for 0]

Device:/$ pm list package | grep myapp
(empty result)

Device:/$ pm list package | grep google
package:com.google.android.inputmethod.latin // which means list package & grep working fine

Device:/$ pm list package -u | grep myapp
package:com.example.myapp // which means pm already acknowledge myapp is uninstalled

So at this moment, I'm at loss. Even adb shell cannot see the app package. But still, when I try to install the APK, I get the error above. How can I resolve this?

Elsieelsinore answered 14/4, 2022 at 12:56 Comment(4)
adb install -r ~/myapp.apk should work as it deleted still existent data and replaces the app with the new version (no update).Wilburwilburn
@Wilburwilburn I've just tried your suggestion, and sadly I still get the same error on the command line. The difference here though, on the tablet, the screen does not linger on the error message "signature does not match", but immediately return to home screen.Elsieelsinore
Just by chance, the app isn't installed as system app on that device (system apps can't be replaced without root permissions)? Check pm list package -d if it is still contained. BTW: If I am not mistaken, if a package is listed in the -u list it means the app is uninstalled but there is still app data present. An app that is really uninstalled is no longer visible in any pm package list.Wilburwilburn
@Wilburwilburn it was not a system app (previously, I also install the APK myself by running the APK from the device's folder after downloading it). I have searched for the app data present using the Files app, searching for "myapp", and removing all related folders, except one folder in the obb folder. I can't seem to remove that com.example.myapp folder inside the obb folder.Elsieelsinore
E
1

For people still facing this issue, yes this issue is still unresolvable to this date. At least I have found out why the issue happens, which is apparently because when I remove an app, Huawei asks whether I would also want to remove the app's data or not. I answer "no". And once you answer "no", you'll never be able to reinstall that app on that device ever again, because of the residue of the app data on your device. And I have tried my best to remove any residue by any means, I still cannot reinstall the app.

Only one cure works: reset factory settings. I did this and now I can reinstall the app. Of course, that means the data will be lost. But at least there's a Huawei backup app, so there's that.

Elsieelsinore answered 12/12, 2022 at 8:19 Comment(1)
I was having the same issue and finally got it working forcing an uninstall from the adb shell: adb shell pm uninstall APK.NAMEOverlong
C
3

That happens when you have a dev version on the device and try and install a version from Play (or the other way around). It is to be expected as Play resigns the app with another key which you can find under the Play Signing tab on the App Integrity page.

You will just need to remove your dev version from the device before you try and load the Play version.

Cafeteria answered 29/4, 2024 at 9:13 Comment(0)
E
1

For people still facing this issue, yes this issue is still unresolvable to this date. At least I have found out why the issue happens, which is apparently because when I remove an app, Huawei asks whether I would also want to remove the app's data or not. I answer "no". And once you answer "no", you'll never be able to reinstall that app on that device ever again, because of the residue of the app data on your device. And I have tried my best to remove any residue by any means, I still cannot reinstall the app.

Only one cure works: reset factory settings. I did this and now I can reinstall the app. Of course, that means the data will be lost. But at least there's a Huawei backup app, so there's that.

Elsieelsinore answered 12/12, 2022 at 8:19 Comment(1)
I was having the same issue and finally got it working forcing an uninstall from the adb shell: adb shell pm uninstall APK.NAMEOverlong
B
0

removing --user 0 worked for me

Beret answered 28/3, 2023 at 22:35 Comment(2)
Ooh interesting. I never heard about this command. Will take a look more. Thanks.Elsieelsinore
Welcome to Stack Overflow! I assume you mean some adb command? Including full command and links to any supporting material you have will improve your answer. Please don't forget to use correct formatting when you editPich
S
0

Just remove the app using the adb shell

adb shell pm uninstall APP.PACKAGE.NAME
Sunroom answered 20/3, 2024 at 13:47 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.