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.
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.
| Layer | Typical symptom | Decisive evidence | Commands to run |
|---|---|---|---|
| File layer | Download is an HTML page, 0 bytes, or a truncated ZIP | file says HTML, unzip -t fails | curl -I, file, unzip -t |
| Manifest parsing layer | Malformed manifest, unsigned APK, targetSdk too low | INSTALL_PARSE_FAILED_*, NO_CERTIFICATES | aapt dump badging, adb logcat |
| Dependency declaration layer | File fine, signature valid, but a library or feature is missing | INSTALL_FAILED_MISSING_SHARED_LIBRARY, MISSING_FEATURE | pm list libraries, dumpsys package libraries |
| Version / signature layer | Overwrite install refused | UPDATE_INCOMPATIBLE, VERSION_DOWNGRADE | pm dump, aapt dump badging |
| Storage / session layer | Stuck on "Installing..." or out of space | INSUFFICIENT_STORAGE, uncommitted session | df /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`:
| Declaration | Library present on device | Library absent on device |
|---|---|---|
required="true" (default / omitted) | Normal install; library code added to the ClassLoader | Install refused with INSTALL_FAILED_MISSING_SHARED_LIBRARY |
required="false" | Normal install, library used | Normal 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
| Kind | Manifest element | Introduced | Physical form | How 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/*.xml | pm list libraries |
| Native shared library | <uses-native-library> | Android 12 / API 31 | /system/lib64/*.so, vendor partition | ls /system/lib64, dumpsys package libraries |
| SDK library | <uses-sdk-library> | Android 13 / API 33 | Versioned SDK library with a certificate digest | dumpsys 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.apkcontent-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 -40pm 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.txt4. 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 -40pm 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 -20aapt 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
- Confirm the file is a real APK:
file,unzip -t,sha256sumall pass. Otherwise go back to bad-package forensics. - Retrieve the full error code: run both
adb install -randadb shell pm install -r, then captureadb logcat -d -s PackageManager. - Classify the layer: only a
MISSING_SHARED_LIBRARYsuffix enters this path.NO_CERTIFICATES,OLDER_SDK,DEPRECATED_SDK_VERSIONandNO_MATCHING_ABISeach have their own branch. - Export manifest declarations:
aapt dump badging | grep uses-librarygives the library names; flag everyuses-library-not-requiredentry. - Export the device library table: save both
adb shell pm list librariesandadb shell dumpsys package libraries. Watch for vendor prefixes such ascom.qualcomm,com.mediatekorvendor.. - Compute the difference: look up each
required=truename from step 4 in step 5's output, and re-checkandroid:requiredviaaapt dump xmltreeto be certain. - Rule out neighbouring causes:
adb shell pm list featuresfor hardware features,adb shell getprop ro.product.cpu.abilistfor ABI,adb shell getprop ro.build.version.sdkfor the API level. Confirm it is not actuallyMISSING_FEATUREorNO_MATCHING_ABIS. - 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".
- 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 code | Trigger | Relation to this topic | First action |
|---|---|---|---|
INSTALL_FAILED_MISSING_SHARED_LIBRARY | A declared required shared library is absent | This article | Use another build or firmware |
INSTALL_FAILED_MISSING_FEATURE | A uses-feature hardware requirement is missing | Same layer, different mechanism | Compare with pm list features |
INSTALL_FAILED_NO_MATCHING_ABIS | Bundled .so files do not match the device ABI | Frequently confused with it | getprop ro.product.cpu.abilist |
INSTALL_FAILED_OLDER_SDK | minSdkVersion exceeds the device API | Opposite version direction | Find an older build |
INSTALL_FAILED_DEPRECATED_SDK_VERSION | Since Android 14, targetSdk below 23 is blocked | Also "old APK on new OS", but a different gate | aapt dump badging | grep sdkVersion |
INSTALL_FAILED_MISSING_SPLIT | Only the base APK was installed, splits missing | Common misread for split bundles | adb install-multiple with the full set |
INSTALL_PARSE_FAILED_NO_CERTIFICATES | APK unsigned or signing block damaged | Signature / file layer | Re-fetch the package |
INSTALL_FAILED_UPDATE_INCOMPATIBLE | Signing certificate differs from the installed package | Overwrite-install branch | See the signature mismatch guide |
INSTALL_FAILED_INSUFFICIENT_STORAGE | /data is full | Unrelated to dependencies | adb shell df -h /data |
INSTALL_FAILED_USER_RESTRICTED | Device policy or parental control blocks installs | Unrelated to dependencies | Inspect 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 option | When it applies | Cost |
|---|---|---|
| Use an official or generic build without the dependency | Most cases | Lowest - recommended |
| Move to the official firmware or a device that ships the library | Dependency is an OEM-private library | Needs the matching device |
Install the complete APK set with adb install-multiple | Really a missing split, not a missing library | Low |
Have the developer set required="false" and degrade via reflection | You control the source or can repackage | Requires re-signing |
| Root the device and drop libraries into a system partition | Theoretically possible | Not recommended - breaks system integrity, breaks on OTA, adds real risk |
adb install-multiple base.apk split_config.arm64_v8a.apk split_config.xxhdpi.apkAvoid 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 version | Relevant behaviour |
|---|---|
| Android 6.0 / API 23 | Apache HTTP client removed from the default classpath, provided as an optional library |
| Android 7.0 / API 24 | android:required semantics settled; Play filters devices by uses-library |
| Android 8–11 | OEM-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 34 | Packages with targetSdk < 23 are blocked (a separate gate, different error code) |
| Android 15 / API 35 | Minimum 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
- APK install failed error codes reference - the full
INSTALL_FAILED_*map - Why an APK won't install - broad first-pass triage
- Forensic triage for a file that is not really an APK - rule out the file layer first
- Installs stuck on "Installing..." - session commit stage
- Installed but crashes on launch - library present, class not resolvable
- Parse-package error fix - manifest parsing layer
- Installed but no icon anywhere - split apps and entry-point components
- Why Android insists on overwriting a same-version APK - the other version-gate branch
- APK won't install in a work profile or second space - user-dimension isolation
- Package visibility and the queries element - another manifest declaration that changes behaviour
- Foreground service type failures on Android 14 - Android 14 manifest gates
- Default app roles that will not stick - manifest declarations and qualification
- Scan an APK for malware without an antivirus - verify the source before switching builds
- gptoapk - check package name, version and build variant before downloading