Sitemap

APK Installation Failed !! — Cheatsheet

2 min readJan 13, 2020

Ever wondered why your android application package just failed to install on a device or emulator, here’s a quick cheat sheet that maps the error code to its root cause.

Even though most of the error codes are self-explanatory there are a few that made me run to google or stack overflow to understand more so here it is.

INSTALL_FAILED_UPDATE_INCOMPATIBLE — If a previously installed package of the same name has a different signature than the new package (and the old package’s data was not removed).

INSTALL_FAILED_VERIFICATION_FAILURE — If the new package couldn’t be installed because the verification timed out. In case you need to disable the verification here are the ADB commands that will let you override the verification which is definitely not recommended.

$ adb shell settings put global verifier_verify_adb_installs 0
$ adb shell settings put global package_verifier_enable 0

INSTALL_FAILED_VERSION_DOWNGRADE — If the new package has an older version code than the currently installed package.

INSTALL_FAILED_DUPLICATE_PERMISSION — If the system failed to install the package because it is attempting to define a permission that is already defined by some existing package.

INSTALL_FAILED_NO_MATCHING_ABIS — If the system failed to install the package because its packaged native code did not match any of the ABIs supported by the system.

INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE — If the old package has target SDK high enough to support runtime permission and the new
package has target SDK low enough to not support runtime permissions.

INSTALL_FAILED_TEST_ONLY — If the new package failed because it has specified that it is a test-only package and the caller has not supplied the test flag.

adb shell pm install -t /tmp/MyApplication.apk

INSTALL_FAILED_OLDER_SDK — If the new package failed because the current SDK version is older than that required by the package.

INSTALL_FAILED_SHARED_USER_INCOMPATIBLE — If the new package is requested a shared user which is already installed on the device and
does not have matching signature.

INSTALL_FAILED_INSUFFICIENT_STORAGE — If the package manager service found that the device didn’t have enough storage space to install the app.

And there are a few more … But these are the ones that I’ve encountered the most.

Reference Links

PackageManager.java — http://androidxref.com/9.0.0_r3/xref/frameworks/base/core/java/android/content/pm/PackageManager.java

--

--

Responses (2)