Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

adb install fails with INSTALL_FAILED_INVALID_APK

ErrorFailure [INSTALL_FAILED_INVALID_APK]

Short answer

The device refused the file as an installable APK. Check what you are installing. A release APK that was never signed, an .aab app bundle, and one piece of a split APK set all fail this way. Sign the APK, build APKs from the bundle with bundletool, or install the splits together with adb install-multiple.

  • Applies to Android Gradle Plugin 8.x, Platform-Tools 36, bundletool, Android 14 to 17
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Look at the file you are installing: its extension and its name. This tells you which cause applies.

    ls -l path/to/your_app*
  2. 2Match what you see, then jump to its fix

    1. 1The file name ends in -unsigned.apkThe release APK is not signedFix
    2. 2The file ends in .aabYou are installing an app bundle (.aab)Fix
    3. 3You downloaded several APKs for the app (base plus splits) and installed oneThe file is one APK of a split setFix

What does the error look like?

  • Failure [INSTALL_FAILED_INVALID_APK]
  • The install fails on a file named like app-release-unsigned.apk

Cause 1 of 3

The release APK is not signed

1Check

The build system does not sign the release version unless you define a signing configuration for it. Output must be signed before it can be deployed to a device.

apksigner verify path/to/app-release-unsigned.apk

2Fix

Sign it, or configure Gradle to sign the release build. To sign by hand, align first, then sign.

zipalign -v -p 4 my-app-unsigned.apk my-app-unsigned-aligned.apk
apksigner sign --ks my-release-key.jks --out my-app-release.apk my-app-unsigned-aligned.apk
apksigner verify my-app-release.apk

3Verify

apksigner verify passes and the install works.

adb install my-app-release.apk

Confirmed by developer.android.com

Did this fix it?

Cause 2 of 3

You are installing an app bundle (.aab)

1Check

You cannot deploy an app bundle directly to a device. It is a publishing format that Google Play turns into APKs.

ls -l path/to/*.aab

2Fix

Build an APK set from the bundle with bundletool and install that, or build an APK with Gradle instead.

bundletool build-apks --bundle=my_app.aab --output=my_app.apks
bundletool install-apks --apks=my_app.apks

3Verify

bundletool reports the install and the app opens.

adb shell pm list packages | grep your.package.name

Confirmed by developer.android.com

Did this fix it?

Cause 3 of 3

The file is one APK of a split set

1Check

APKs downloaded from Play Console for a specific device come as several files that belong together.

ls -l *.apk

2Fix

Install all of them in one command.

adb install-multiple base.apk split_config.arm64_v8a.apk split_config.en.apk

3Verify

The command prints Success and the app starts.

adb shell pm list packages | grep your.package.name

Confirmed by developer.android.com

Did this fix it?

How do I stop it coming back?

  • Use installDebug during development; the debug build is signed with the debug key for you.
  • Add a release signing config to Gradle so release builds are never left unsigned.
  • Keep one folder of the exact files you test, so base and split APKs stay together.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

Android Studio cannot pair the phone over Wi-Fi

The Pair devices over Wi-Fi dialog lists no device

Wireless pairing needs the phone on Android 11 or higher and on the same Wi-Fi network as the computer, with current Platform-Tools.

4 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.