4

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?

Chen Li Yong
  • 5,459
  • 8
  • 58
  • 124
  • `adb install -r ~/myapp.apk` should work as it deleted still existent data and replaces the app with the new version (no update). – Robert Apr 14 '22 at 13:08
  • @Robert 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. – Chen Li Yong Apr 14 '22 at 13:13
  • 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. – Robert Apr 14 '22 at 13:29
  • @Robert 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. – Chen Li Yong Apr 14 '22 at 15:17

2 Answers2

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.

Chen Li Yong
  • 5,459
  • 8
  • 58
  • 124
  • I was having the same issue and finally got it working forcing an uninstall from the adb shell: ```adb shell pm uninstall APK.NAME``` – adrianlzt Feb 12 '23 at 17:39
0

removing --user 0 worked for me

  • Ooh interesting. I never heard about this command. Will take a look more. Thanks. – Chen Li Yong Mar 29 '23 at 04:39
  • 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](https://stackoverflow.com/help/formatting) when you [edit] – Sergei Kozelko Mar 29 '23 at 10:12