5

I recently got a Huawei P30 and used adb to remove some preinstalled apps I didn't want to use. I went a bit too far and removed the system gallery app (com.android.gallery3d) which turns out to be problematic for multiple things, such as opening taken pictures directly from the camera app.

I've tried reinstalling it but I'm facing multiple issues:

  • When trying to install the APK that's still on the phone in /system/priv-app/Gallery2, I get a INSTALL_PARSE_FAILED_NO_CERTIFICATES error. The full error:
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certificates from /data/app/vmdl30820468.tmp/base.apk: /data/app/vmdl30820468.tmp/base.apk: File res/drawable-xxxhdpi-v4/img_patten_7.jpg in manifest does not exist]
  • When trying to install a version I found online, I get a INSTALL_FAILED_VERSION_DOWNGRADE, which is odd as the app is supposed to be uninstalled. It doesn't appear in pm list packages, however running dumpsys package com.android.gallery3d does give a result, and the version is indeed more recent than the one I'm trying to install (9.1.1.309 vs 9.0.15.355). Using the -d flag when installing doesn't help as it's not a debug app. I couldn't find a more recent version online.

Is there a way to reinstall this app that doesn't involve a factory reset? Alternatively, is there a way to install a different version of it? It seems like com.android.gallery3d is a generic package name, I wouldn't be against having the "stock" Android one.

11
  • When the APK is still in /system/priv-app/*, the app isn't uninstalled. Are you sure you didn't just disable it? What command did you use to uninstall via ADB?
    – Izzy
    Commented Apr 26, 2019 at 19:12
  • I used adb uninstall -k --user 0 com.android.gallery3d. Trying to run it again results in a not installed for 0 error (with or without the -k flag). Not specifying the user also gives an error, DELETE_FAILED_INTERNAL_ERROR
    – Jukurrpa
    Commented Apr 26, 2019 at 19:49
  • That only uninstalled it for that one user, but leaves the APK there (theoretically, a second user could still run it). Have you tried adb shell "pm install -r <package.apk>" (replacing <package.apk>` by the path to the installed APK file) or, if you have it on your PC, adb install -r <APKfile>? The important thing is the -r (re-install even if its there).
    – Izzy
    Commented Apr 26, 2019 at 20:35
  • The -r flag doesn't help, same issues with both methods (apk left on the device and the one I downloaded)
    – Jukurrpa
    Commented Apr 26, 2019 at 21:02
  • That's ugly. Just guessing: what happens when you introduce the --user 0 here as well? Then it can neither claim a wrong version nor that it's already there. If that doesn't work either, please try pm default-state app.name (taken from this XDA post). I've never had that situation.
    – Izzy
    Commented Apr 26, 2019 at 21:12

1 Answer 1

5

The solution can be found in the question Reinstall System app which is uninstalled for the current user? (which is unanswered):

adb shell cmd package install-existing com.android.gallery3d

Note this doesn't work in Android 5 (hence the other question), as the cmd command was only added later (I don't remember exactly when, but it's available in Android 7 at least).

1
  • And you can uninstall it with adb shell cmd package uninstall com.android.gallery3d
    – heralight
    Commented Feb 15, 2023 at 10:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .