ADB claims that app is not installed when uninstalling and that it is installed when installing 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
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.)