Changing to a higher AndroidTargetSDK - users stuck on old APK version

My Ionic2 Android app (ver 1.3.0) is live in Google Play and the APK has an SDK version of 23.
It did not have a targetSDK version set in config.xml (only a minSDK of 16).

I then removed my local Android platform and readded it with the latest Ionic CLI tools (3). I noticed that it was now set to SDK of 25. I used Ionic Cloud to package my app and generate a new release APK (1.4.0).

When I uploaded it to Google Play, I received a message “Non-upgradable APK”. I could not find any information on it and published my app, which was a mistake.

Now NEW users can install the new version (SDK 25) but all existing users of the app cannot. They can see the new version in Google play but it just says “Open”, not “Update”.

I tried to do a new build with a specific version of 23 - 1.4.1 which worked.
<preference name="android-targetSdkVersion" value="23"/>

I could not see a way to roll back to 1.3.0 and publish 1.4.1, so I published 1.4.1 and deactivated 1.4.0.

However the original users of 1.3.0 STILL cannot upgrade to 1.4.1 version and it looks like they will be stuck on that version. The 1.4.0 users can upgrade to 1.4.1.

My question is: How can I make my new build compatible with the old users (is it something to do with the TargetSDK version or not?)

And if so, how do I migrate everyone onto 25 (the latest)?

Just some background information:
All that SDK version stuff is part of Cordova, more precise cordova-android. You probably installed a new Cordova version with the new CLI, too (use ionic info to find out)? The newer Cordova version defaults to a newer cordova-android version, as only the newest ones are compatible with the newest Android Studio, Android SDK etc. (You can check your cordova-android version via ionic cordova platform list).

Here is the output:

global packages:

@ionic/cli-utils : 1.1.2
Cordova CLI      : 6.5.0
Ionic CLI        : 3.1.2

local packages:

@ionic/app-scripts              : 1.3.4
@ionic/cli-plugin-cordova       : 1.1.2
@ionic/cli-plugin-ionic-angular : 1.1.2
Ionic Framework                 : ionic-angular 3.1.1

System:

Node       : v6.10.0
OS         : Windows 10
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed

But that is going to happen - I would not have thought that would affect the upgrade path on Android Play?

It shouldn’t, to be honest. At least not in that way.

Can you share the AndroidManifest.xml of both versions?

Thanks, it seems that it is a bug in the Android generated version - I received an answer on SO which I used to fix it: http://stackoverflow.com/questions/44061660/what-causes-this-android-apk-upload-error-non-upgradable-apk/44070233#44070233

So I think the TargetSDK was a red-herring.

Wow, this still exists in current Cordova versions!? Was broken / unreliable 3 years ago…