Can't reinstall an app uninstalled through ADB


Question

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.


Answer

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).


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes