Sphere
Log in Join
☆ 5

INSTALL_FAILED_VERSION_DOWNGRADE when installing a debug apk

Trying to install a debug APK over a release build on the same physical device via adb install -r app-debug.apk. Fails: Failure [INSTALL_FAILED_VERSION_DOWNGRADE]. The debug build has versionCode 41 and the installed one has 42 (a release build from CI). I thought -r allowed replacing regardless. Do I have to bump the versionCode every time, or uninstall first? I would rather not wipe the app data just to test a build.

⚑ Report

4 replies

☆ 0
G ghost ·2026-10-23#1

adb install -r allows reinstall but Android still enforces versionCode, you cannot go from 42 to 41 even with -r. Options: adb uninstall the package first (loses data), or bump versionCode in the debug build above 42. Some teams set a different applicationId suffix for debug (.debug) so debug and release coexist.

⚑ Report
☆ 0
P plastic17 ·2026-10-26#2

I went with the applicationIdSuffix '.debug' for the debug build type. Now debug and release install side by side and I do not touch versionCode for local dev. Uninstalling would have wiped the test data I needed. It took a while to realize the two could just coexist.

⚑ Report
☆ 0
G ghost ·2026-10-29#3

That is the cleanest approach. Just remember any content provider authorities or deep link hosts need the suffix too, or you will get conflicts when both are installed. We spent a day on that after adding the suffix. Deep links were the part that surprised us.

⚑ Report
☆ 0
I inode ·2026-11-05#4

If you ever do need to force-install an older version without uninstalling, adb install -r -d allows version downgrade (-d = allow downgrade). But that is a debugging escape hatch, not something to bake into your flow. Still, I would not use it in a normal release flow.

⚑ Report
Log in to reply.