Warning Android API level 28 with ionic-v3 and cordova 6.3.0

for me what works finaly was just this :

<preference name="android-targetSdkVersion" value="28" />


After spend some time on this error i found this three solution.

solution 1

ionic cordova platform rm android

ionic cordova platform add [email protected]

solution 2

<preference name="android-targetSdkVersion" value="28" />

solution 3 (if above solution not work then only)

  1. Follow this step
    1. Update Your sdk to api level 28 from android studio.
    2. Create new project with "ionic start".
    3. Copy paste your old code to this new created project and install your all plugin and it's Done!

changing directly the uses-sdk is not the correct answer, at least not enough nor good answer...

you better update the cordova android engine to the latest version. Its default target sdk version is already 28. (see https://github.com/apache/cordova-android/issues/791 ). Only changing it in config.xml just returned with bunch of rarely errors.

https://cordova.apache.org/docs/en/latest/config_ref/#engine