APK Downloader
·14 min read

APK Won't Install: INSTALL_FAILED_MISSING_SHARED_LIBRARY, uses-library and Device Dependencies, Diagnosed Step by Step

adb install returns INSTALL_FAILED_MISSING_SHARED_LIBRARY while the phone only says 'App not installed'. The file is not corrupt and the signature is valid - the manifest declares a shared library this device does not have. This guide explains the three dependency classes (Java shared libraries, Android 12 native shared libraries, Android 13 SDK libraries), with runnable pm / dumpsys / aapt / apkanalyzer / adb / curl commands, a nine-step diagnostic path, an error-code reference, four real-world scenarios and 10 FAQs.

shared libraryuses-libraryINSTALL_FAILED_MISSING_SHARED_LIBRARYadbsideloading

You tap an APK on the phone, the installer spins for a moment, and then: "App not installed." No reason. You move to a computer, run adb install, and finally get something actionable: Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY].

The instinct is to assume the download is broken or the signature is wrong, then re-download, clear caches, reboot, or even try to re-sign the package. None of that helps. This error code has a very precise meaning: the APK's AndroidManifest.xml declares, via `<uses-library>`, a shared library that must exist, and PackageManager cannot find it on this device. The file is intact. The certificate is valid. One of the app's runtime preconditions simply is not met on this particular machine.

That puts it in a different layer from a bad download. A file that is really an HTML interstitial is a *file-layer* problem; this is a *manifest-declared dependency* gate enforced at install time. Misclassifying the layer makes every subsequent step wasted effort. This guide follows a fixed order - confirm the file, read the manifest, inventory the device, then choose a fix - and gives the exact command and the exact thing to look for at each step.

1. Classify the failure before touching anything

The same "App not installed" message can come from five different layers.

LayerTypical symptomDecisive evidenceCommands to run
File layerDownload is an HTML page, 0 bytes, or a truncated ZIPfile says HTML, unzip -t failscurl -I, file, unzip -t
Manifest parsing layerMalformed manifest, unsigned APK, targetSdk too lowINSTALL_PARSE_FAILED_*, NO_CERTIFICATESaapt dump badging, adb logcat
Dependency declaration layerFile fine, signature valid, but a library or feature is missingINSTALL_FAILED_MISSING_SHARED_LIBRARY, MISSING_FEATUREpm list libraries, dumpsys package libraries
Version / signature layerOverwrite install refusedUPDATE_INCOMPATIBLE, VERSION_DOWNGRADEpm dump, aapt dump badging
Storage / session layerStuck on "Installing..." or out of spaceINSUFFICIENT_STORAGE, uncommitted sessiondf /data, pm list sessions

This article covers only the third row. If file or unzip -t already fails, stop here and read forensic triage for a file that is not really an APK first.

2. The mechanism: what PackageManager actually checks

Android applications are linked automatically against the default framework classes - android.app, android.content, android.view, android.widget and friends. Anything else that lives in a separate shared library must be declared explicitly in the manifest so the system adds that library's code to the package's class loader.

<application ...>
    <uses-library android:name="android.test.runner" />
    <uses-library android:name="org.apache.http.legacy" android:required="false" />
</application>

The decisive attribute is android:required, and its default is `true`:

DeclarationLibrary present on deviceLibrary absent on device
required="true" (default / omitted)Normal install; library code added to the ClassLoaderInstall refused with INSTALL_FAILED_MISSING_SHARED_LIBRARY
required="false"Normal install, library usedNormal install; app must detect availability at runtime and degrade

So this is not a compatibility *hint* - it is a hard install-time gate. The same element also drives Google Play device filtering: the store excludes devices that do not satisfy an app's <uses-library> declarations. Sideloading bypasses the store filter, so the gate lands on the device's own PackageManager instead. That is exactly why sideloaders hit it far more often than Play users.

A third point that is easy to miss: `required="true"` only guarantees the install-time check passes; it does not guarantee the class resolves at runtime. The library may exist but be the wrong version, stripped, or obfuscated. That produces an install that succeeds followed by an immediate crash - a separate branch covered in installed but crashes on launch.

Three kinds of library, three diagnostic paths

KindManifest elementIntroducedPhysical formHow to query the device
Java framework shared library<uses-library>API 1 (android:required since API 7)/system/framework/*.jar registered via /system/etc/permissions/*.xmlpm list libraries
Native shared library<uses-native-library>Android 12 / API 31/system/lib64/*.so, vendor partitionls /system/lib64, dumpsys package libraries
SDK library<uses-sdk-library>Android 13 / API 33Versioned SDK library with a certificate digestdumpsys package libraries

XML files under /vendor/etc/permissions/, /product/etc/permissions/ and /system_ext/etc/permissions/ also register libraries. That explains the most common support question of all: the same APK installs on one brand of phone and fails on another. OEM-private libraries ship with the ROM; no ordinary APK a user downloads can supply them.

3. Four baseline commands before you start

Nail down the file side first, so a bad download is not misdiagnosed as a missing device library.

URL="https://example.com/path/app.apk"
curl -sSIL "$URL" | grep -iE "^(HTTP/|content-type|content-length|location)"
curl -fL --retry 2 -o app.apk "$URL"
file app.apk
unzip -t app.apk | tail -3
sha256sum app.apk

content-type should be application/vnd.android.package-archive or application/octet-stream. If you see text/html, you fetched a landing page or a verification interstitial instead. Only proceed once unzip -t reports no errors and file identifies a Zip/JAR archive.

Then capture the device's baseline facts:

adb devices
adb shell getprop ro.build.version.sdk
adb shell getprop ro.build.version.release
adb shell pm list libraries
adb shell dumpsys package libraries
adb shell pm list features | head -40

pm list libraries prints the set of shared libraries currently known on this device - that is the core reference for the comparison below. Save it:

adb shell pm list libraries > device-libs.txt

4. Force the phone to reveal the real error code

The on-device installer usually says nothing beyond "App not installed". adb gives you the whole string:

adb install -r app.apk
adb push app.apk /data/local/tmp/app.apk
adb shell pm install -r /data/local/tmp/app.apk
adb logcat -d -s PackageManager PackageInstaller | grep -iE "INSTALL_FAILED|library|missing" | tail -40

pm install runs through the device-side PackageInstaller and often prints a longer explanation than adb install. Logcat frequently also names which specific library is missing - that is the single most valuable clue in the whole process.

5. Read the manifest: find out what was actually declared

aapt dump badging app.apk | grep -iE "uses-library|sdkVersion|native-code|uses-feature"
aapt dump xmltree app.apk AndroidManifest.xml | grep -A 4 -B 1 "uses-library"
apkanalyzer manifest print app.apk | grep -A 4 "uses-library"
unzip -l app.apk | grep -E "lib/|classes.*\.dex" | head -20

aapt dump badging has two lines worth noting: a required library prints as uses-library:'xxx', while an optional one prints as uses-library-not-required:'xxx'. If you see `uses-library-not-required`, that declaration is not the cause of this failure - do not spend time on it.

Only aapt dump xmltree shows the real value of android:required. In a binary manifest an omitted attribute means true, so this step cannot be guessed.

6. A nine-step diagnostic path

  1. Confirm the file is a real APK: file, unzip -t, sha256sum all pass. Otherwise go back to bad-package forensics.
  2. Retrieve the full error code: run both adb install -r and adb shell pm install -r, then capture adb logcat -d -s PackageManager.
  3. Classify the layer: only a MISSING_SHARED_LIBRARY suffix enters this path. NO_CERTIFICATES, OLDER_SDK, DEPRECATED_SDK_VERSION and NO_MATCHING_ABIS each have their own branch.
  4. Export manifest declarations: aapt dump badging | grep uses-library gives the library names; flag every uses-library-not-required entry.
  5. Export the device library table: save both adb shell pm list libraries and adb shell dumpsys package libraries. Watch for vendor prefixes such as com.qualcomm, com.mediatek or vendor..
  6. Compute the difference: look up each required=true name from step 4 in step 5's output, and re-check android:required via aapt dump xmltree to be certain.
  7. Rule out neighbouring causes: adb shell pm list features for hardware features, adb shell getprop ro.product.cpu.abilist for ABI, adb shell getprop ro.build.version.sdk for the API level. Confirm it is not actually MISSING_FEATURE or NO_MATCHING_ABIS.
  8. Choose a fix: use a build that does not depend on that private library, or a universal/generic variant, or move to a device/official firmware that provides it. Do not try to "install a shared library APK".
  9. Verify after install: adb shell pm path <package>, adb shell dumpsys package <package> | grep -A 6 -i "usesLibrary\|libraries", then cold-start the app once to confirm it is not an install-then-crash case.

7. Install error-code reference

Error codeTriggerRelation to this topicFirst action
INSTALL_FAILED_MISSING_SHARED_LIBRARYA declared required shared library is absentThis articleUse another build or firmware
INSTALL_FAILED_MISSING_FEATUREA uses-feature hardware requirement is missingSame layer, different mechanismCompare with pm list features
INSTALL_FAILED_NO_MATCHING_ABISBundled .so files do not match the device ABIFrequently confused with itgetprop ro.product.cpu.abilist
INSTALL_FAILED_OLDER_SDKminSdkVersion exceeds the device APIOpposite version directionFind an older build
INSTALL_FAILED_DEPRECATED_SDK_VERSIONSince Android 14, targetSdk below 23 is blockedAlso "old APK on new OS", but a different gateaapt dump badging | grep sdkVersion
INSTALL_FAILED_MISSING_SPLITOnly the base APK was installed, splits missingCommon misread for split bundlesadb install-multiple with the full set
INSTALL_PARSE_FAILED_NO_CERTIFICATESAPK unsigned or signing block damagedSignature / file layerRe-fetch the package
INSTALL_FAILED_UPDATE_INCOMPATIBLESigning certificate differs from the installed packageOverwrite-install branchSee the signature mismatch guide
INSTALL_FAILED_INSUFFICIENT_STORAGE/data is fullUnrelated to dependenciesadb shell df -h /data
INSTALL_FAILED_USER_RESTRICTEDDevice policy or parental control blocks installsUnrelated to dependenciesInspect device policy

For the full map, see the APK install failed error codes reference. If the failure happens at session commit instead, see installs stuck on "Installing...". And for a broad first-pass triage, why an APK won't install is a useful companion.

8. Four real-world scenarios

Scenario A: an old utility references `android.test.runner`. This is the instrumentation test library, normally present only on engineering images or systems with the test framework installed. pm list libraries will not contain it, while the manifest declares it as required. Such a package was never meant for a retail device; the correct fix is a release build without the test dependency, not an attempt to inject a library into the system.

aapt dump xmltree app.apk AndroidManifest.xml | grep -A 3 "android.test.runner"
adb shell pm list libraries | grep -i "test.runner" || echo "device: NOT PRESENT"

Scenario B: `org.apache.http.legacy` marked as required. Since Android 6.0 the Apache HTTP client was removed from the default bootclasspath and is provided as an optional library instead. A correct build sets required="false"; a careless build - or a Gradle plugin that back-fills the declaration - omits the attribute, so required becomes true and the install is refused on devices that do not register the library.

aapt dump badging app.apk | grep -i "apache"
adb shell pm list libraries | grep -i "apache.http" || echo "device: NOT PRESENT"

Scenario C: OEM-private libraries. A library name carrying a vendor prefix means the APK was built for a specific brand or ROM. The same file will necessarily fail elsewhere, and no user-side install can supply the missing piece - those libraries come from the /vendor partition or the system image. The fix is a generic/universal build.

aapt dump badging app.apk | grep -i "uses-library"
adb shell pm list libraries | grep -iE "qualcomm|mediatek|vendor\.|oem" || echo "device: none"

Scenario D: Android 12+ native shared libraries. <uses-native-library android:name="libOpenCL.so" android:required="true"/> requires that .so to exist in a system partition. Check the device:

aapt dump xmltree app.apk AndroidManifest.xml | grep -A 3 "uses-native-library"
adb shell ls /system/lib64/ | grep -iE "opencl|vulkan|neuralnetworks" || echo "device: NOT PRESENT"

9. Fix options, and things you should explicitly not do

Viable optionWhen it appliesCost
Use an official or generic build without the dependencyMost casesLowest - recommended
Move to the official firmware or a device that ships the libraryDependency is an OEM-private libraryNeeds the matching device
Install the complete APK set with adb install-multipleReally a missing split, not a missing libraryLow
Have the developer set required="false" and degrade via reflectionYou control the source or can repackageRequires re-signing
Root the device and drop libraries into a system partitionTheoretically possibleNot recommended - breaks system integrity, breaks on OTA, adds real risk
adb install-multiple base.apk split_config.arm64_v8a.apk split_config.xxhdpi.apk

Avoid two popular "fixes" in particular. First, downloading a supposed "shared library installer APK" from an unknown source: a shared library is not an ordinary APK, installing it will not register anything in pm list libraries, and it is a classic malware delivery vector. Second, casually re-signing or repackaging the file: that trades this error for INSTALL_FAILED_UPDATE_INCOMPATIBLE, covered in APK signature mismatch when the app won't install.

10. Behaviour by Android version

Android versionRelevant behaviour
Android 6.0 / API 23Apache HTTP client removed from the default classpath, provided as an optional library
Android 7.0 / API 24android:required semantics settled; Play filters devices by uses-library
Android 8–11OEM-private libraries proliferate; /vendor/etc/permissions participates in registration
Android 12 / API 31<uses-native-library> added - native .so files can be install-time required dependencies
Android 13 / API 33<uses-sdk-library> added - libraries carry a version and certificate digest
Android 14 / API 34Packages with targetSdk < 23 are blocked (a separate gate, different error code)
Android 15 / API 35Minimum installable targetSdk raised to 24

The last two rows are not shared-library errors. They produce INSTALL_FAILED_DEPRECATED_SDK_VERSION; although they also look like "an old APK won't install on a new OS", the remedy is different (adb install --bypass-low-target-sdk-block exists for testing only).

11. FAQ

Q1: The phone only says "App not installed" - how do I know it is a missing library?

Run adb install -r app.apk or adb shell pm install -r /data/local/tmp/app.apk; the full error code appears in the terminal. You can also grep adb logcat -d -s PackageManager | grep -i library.

Q2: Is `INSTALL_FAILED_MISSING_SHARED_LIBRARY` the same as having no Google Play services?

No. The former is an install-time PackageManager gate over a <uses-library> declaration; the latter is an entire missing runtime service stack. The evidence chain and the remedy are different.

Q3: Will re-downloading the APK fix it?

Not if the error really is a missing library. Re-downloading only addresses corruption or an HTML page being served. Rule that out first with file and unzip -t.

Q4: `pm list libraries` contains the library name - why does the install still fail?

Check three things: whether android:required is true in aapt dump xmltree; whether it is a <uses-native-library> or <uses-sdk-library> (those do not necessarily appear in the Java library list); and whether the real error is MISSING_FEATURE or NO_MATCHING_ABIS being misread.

Q5: Does `required="false"` solve everything?

The install will pass, but if the app calls library classes without a runtime probe it will throw NoClassDefFoundError. That is a runtime problem - see installed but crashes on launch.

Q6: Can I just install the shared library myself?

As a normal user, no. Shared libraries are registered by the system image and XML files under /system/etc/permissions; they are not sideloadable APKs. Switching builds or firmware is the real fix.

Q7: What does `uses-library-not-required` in `aapt dump badging` mean?

That library is declared optional and cannot cause an install-time refusal. Focus on the other uses-library lines.

Q8: Is it normal that the same APK installs on phone A but not phone B?

Yes, and it strongly points to an OEM-private library. Run pm list libraries on both devices and diff the outputs.

Q9: Does a missing split APK produce the same error?

No - that is usually INSTALL_FAILED_MISSING_SPLIT. Install the whole set with adb install-multiple; see installing split APKs and installed but no icon anywhere.

Q10: How do I prevent this before installing?

Check the package name, version and build variant on the download page and prefer a universal build. For source verification, see scan an APK for malware without an antivirus and the 48-hour post-install audit.

12. Related reading