I want to update my app from oldest android versions to new ones but still be able to keep it running from 5.1 android version devices till the newest ones.
I use cordova cli from windows cmd and :
if i use until cordova android@11 (22 sdk) everything works fine in 5.1 android devices till new ones but if i upgrade to android@15 (37 sdk which accepts minimum 21) i have to set cdvMinSdkVersion=22 in gradle.properties file so it can run in 5.1 android device but it never happens. It always crashes before the deviceready state with the alert :
Time
Unfortunately, Hello Cordova has stopped.
Except the cdvMinSdkVersion=22 in gradle.properties file
i also used the <preference name="android-minSdkVersion" value="22" /> in config.xml
None of them is working in my 5.1 android device.
I do this in a new clean app trying to test the versions. The only dependecy for the app is full network access.
It runs only if i use the android@11 version any other version fails.
I tested all versions from 11 to 15 and all others failed.
The debug error is that there is an error on the version
Any suggestion on it and what to do ?
Please have a look at Cordova's Android API Level Support. The newest (at the time of writing) cordova-android 15 only supports API levels 24-36. The latest version that supports API level 22 is cordova-android 11.
You either need to drop support for Android 5 devices (and Android 6, with Android 7 being the oldest supported Android version), or downgrade cordova-android to version 11.