ADB claims that app is not installed when uninstalling and that it is installed when installing


Question

Gboard kept crashing when trying to open the settings, so I wanted to uninstall and reinstall it. Google Play Store kept giving me the error code 910, the advice for that was installing it with ADB.



The command



adb install -r /home/fabian/Downloads/com.google.android.inputmethod.latin_7.9.7.230658658-release-armeabi-v7a-26790713_minAPI21\(armeabi-v7a\)\(nodpi\)_apkmirror.com.apk


gives me the output



Failed to install /home/fabian/Downloads/com.google.android.inputmethod.latin_7.9.7.230658658-release-armeabi-v7a-26790713_minAPI21(armeabi-v7a)(nodpi)_apkmirror.com.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install com.google.android.inputmethod.latin without first uninstalling package running as com.android.inputmethod.latin]


This is weird, since with the -r flag it should have no problem with an app that is already installed. Apart from that, it is not installed, I checked the app list, the /system/app directory, as well as /data/data. And when I run



adb uninstall com.google.android.inputmethod.latin


, the output is:



Exception occurred while dumping:
java.lang.IllegalArgumentException: Unknown package: com.google.android.inputmethod.latin
at com.android.server.pm.Settings.isOrphaned(Settings.java:4134)
at com.android.server.pm.PackageManagerService.isOrphaned(PackageManagerService.java:18419)
at com.android.server.pm.PackageManagerService.deletePackage(PackageManagerService.java:15836)
at com.android.server.pm.PackageInstallerService.uninstall(PackageInstallerService.java:888)
at com.android.server.pm.PackageManagerShellCommand.runUninstall(PackageManagerShellCommand.java:792)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:118)
at android.os.ShellCommand.exec(ShellCommand.java:94)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:18682)
at android.os.Binder.shellCommand(Binder.java:468)
at android.os.Binder.onTransact(Binder.java:367)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2387)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:3150)
at android.os.Binder.execTransact(Binder.java:565)


So what can I do to install GBoard again?



Fairphone 2, Android 7.1.2, "Fairphone Open", root enabled


Answer

It seems like the package wasn't properly uninstalled : This happens usually if you delete the APK from /data/app or /system/app or /system/priv-app instead of uninstalling the app. That is why probably the adb uninstall command isn't working.



Maybe you can try reinstalling the app again after rebooting your phone?
Tip: If this is the only keyboard app on your phone, it would be better if you install another keyboard app just as a backup before rebooting (especially if you have a text lock screen password).



If it still doesn't work after rebooting, try uninstalling the app only for the current user and then reinstall it from the play store.



adb shell pm uninstall --user 0 com.google.android.inputmethod.latin


Also, if possible, please also share the output of this command



adb shell dumpsys package com.google.android.inputmethod.latin


(Sorry, I am a new member and do not have commenting permissions yet; that is why I have to mention it here.)


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