APK errors

INSTALL_FAILED_INSUFFICIENT_STORAGE

Error text

Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]
adb: failed to install app.apk: Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]

Cause

The phone does not have enough storage to install. Android wants several times the APK size in free space.

Step-by-step fix

  1. Check free space with adb shell df /data.
  2. Clear app caches with adb shell pm trim-caches 1G.
  3. Remove unneeded apps: adb uninstall package.
  4. On an emulator, enlarge storage in AVD Manager.
  5. Shrink your APK through AAB and ABI splits.

Example commands

adb shell df /data
adb shell pm trim-caches 1G
adb shell pm list packages -3
adb uninstall com.example.unused

How to prevent it

Keep the app small: compress images and remove unused resources.

Author and license: Nibras Code