adb install fails with INSTALL_FAILED_INVALID_APK
Failure [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.
Fix it fast
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*2Match what you see, then jump to its fix
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.apk2Fix
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.apk3Verify
apksigner verify passes and the install works.
adb install my-app-release.apkConfirmed by developer.android.com
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/*.aab2Fix
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.apks3Verify
bundletool reports the install and the app opens.
adb shell pm list packages | grep your.package.nameConfirmed by developer.android.com
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 *.apk2Fix
Install all of them in one command.
adb install-multiple base.apk split_config.arm64_v8a.apk split_config.en.apk3Verify
The command prints Success and the app starts.
adb shell pm list packages | grep your.package.nameConfirmed by developer.android.com
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 will not install the app: the device's Android version is too old
INSTALL_FAILED_OLDER_SDK
The system refuses to install an app when its minSdk is higher than the API level of the device or emulator.
3 causes, each with a fixMobile apps
adb cannot start because something already holds its port
adb start-server failed
The adb server must bind local TCP port 5037, and every adb client talks to it there.
2 causes, each with a fixMobile apps
The phone shows as unauthorized and Android Studio will not run the app
adb devices lists the phone but Android Studio cannot deploy to it
An unauthorized phone means it has not trusted this computer's RSA key.
3 causes, each with a fixMobile 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 fixMobile apps
adb cannot connect to its daemon or start the server
* daemon started successfully *
The adb server is a background process on your computer that listens on TCP port 5037.
2 causes, each with a fixMobile apps
adb prints 'server version doesn't match this client; killing...'
adb server version doesn't match this client; killing...
adb runs a background server, and every adb command is a client.
3 causes, each with a fix