When running an Android Test from Android Studio I always get:

Failure [INSTALL_FAILED_VERSION_DOWNGRADE]

This happens even if I have uninstalled the app or created a fresh virtual device.

Any idea what this is and how to solve it?

有帮助吗?

解决方案

I was also getting this same error on a fresh install when testing in Android Studio. In my case I changed the name of the testPackageName. This was the same as the default package name.

Now the tests are running smoothly. I don't know why it worked but it did. Increasing the versionCode should have worked but it didn't.

其他提示

INSTALL_FAILED_VERSION_DOWNGRADE means that the app installed on the device/simulator has lower versionCode that the build you are trying to install. You need to uninstall it first, or bump versionCode

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top