Config.xml android-targetSdkVersion value="28" being built value="27"


I am currently trying to release an update to Google Play. I am using Ionic 3.

My config.xml has the following property:

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


cordova-android": "^8.0.0"

I build from the command line with the following command:

ionic cordova build android --prod --release

If I look in platforms\android\app\src\main\AndroidManifest.xml I see the following:

<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" />

I then open up Android Studio (using 3.4.2) to generate the signed apk - Note in the SDK Manager under SDK Platforms Android 9 (Pie) API 28 is installed - and generate the .apk.

When I try to create a new release in the app store I get the following:

#### Warnings

Your app currently targets API level 27 and must target at least API level 28 to ensure it is built on the latest APIs optimized for security and performance.

I then searched the Android Project in Android Studio and see the following in platform\app\build.gradle:

Android {
    defaultConfig {
        versionCode cdvVersionCode ?: new BigInteger("" + privateHelpers.extractIntFromManifest("versionCode"))
        applicationId privateHelpers.extractStringFromManifest("package")
        minSdkVersion 19
        **targetSdkVersion 27**

        if (cdvMinSdkVersion != null) {
            minSdkVersion cdvMinSdkVersion

Why is this 27?

I changed it in my project and reopened Android Studios and was able to generate an .apk with a target SDK version of 28.

Thanks for any insight.

@BrentAshWilliams Can you please let me know whether you got any solution to update target to Android 9 (API level 28) ?

I created a new project from scratch and added the following to my config.xml:

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

I changed on config.xml to :
<preference name="android-targetSdkVersion" value="28" />
but it didn’t work so I remove the platform by using :
cordova platform remove android
then add the latest :

cordova platform add android@latest

**I got the solution from