Android error during deploy

When I attempt to deploy my Ionic app to a USB-connected device via ‘ionic run android’, I’m getting the error ‘INSTALL_FAILED_VERSION_DOWNGRADE’.

However, I’ve updated the ‘version’ setting in config.xml, and inspection of the generated AndroidManifest.xml shows that android:versionCode and android:versionName have the expected values.

The version already installed has version set to ‘1.0.1’ in config.xml, and the corresponding values in AndroidManifest.xml are ‘10001’ and ‘1.0.1’. The new version I’m trying to install has the version set to ‘1.1.0’, and the corresponding values in AndroidManifest.xml are ‘10100’ and ‘1.1.0’.

This appears to happen regardless of what values I set for version in config.xml (I’ve tried various combinations, including ‘2.0.0’, all of which fail in the same way).

It happily installs if I remove the previous version. Of course, that’s not really acceptable for a production application.

Anyone have any idea what’s happening here?

(Disclaimer: the original app is quite old; it was created with version 1.3.22 of the Ionic CLI, and version 1.0.0-rc.5 of the Ionic library. The purpose of this version of the app is to bring it up to the latest Ionic, which I’ve installed on another PC so I can compare both versions during the upgrade. New versions being used are 2.0.0 (CLI) and 1.3.1 (Ionic library). Not sure if this is relevant, just wanted to mention it in case it is.)