Home > Blockchain >  How to upgrade target API to 31 android
How to upgrade target API to 31 android

Time:09-21

I am trying to upload my aab file on playstore but am getting this message enter image description here

How can I upgrade my API level to 31.

Part of my Gradle file

    ext {
        buildToolsVersion = "29.0.3"
        minSdkVersion = 23
        compileSdkVersion = 30
        targetSdkVersion = 30
        ndkVersion = "20.1.5948944"
        glideVersion = "4.11.0"
        kotlin_version = "1.3.50"
        supportLibVersion = "28.0.0"
        libre_build = !(isPlay.toBoolean())
        .............................
        ............................

    }

CodePudding user response:

The console is saying that your app is currently targeting API Level 30 instead of 31.

So, all you have to do is to change your targetSdkVersion from 30 to 31 and check if the app behavior hasn't changed.

On my side, I wrote this

android {
    compileSdk 33

    defaultConfig {
        applicationId "com.doe.john"
        minSdk 23
        targetSdk 31
        versionCode 15
        versionName "0.10.1"
        ...
    }
...
}

CodePudding user response:

You don't need to use buildToolsVersion

You can made like this:

ext {
        minSdkVersion = 23
        compileSdkVersion = 31
        targetSdkVersion = 31
        ndkVersion = "20.1.5948944"
        glideVersion = "4.11.0"
        kotlin_version = "1.3.50"
        supportLibVersion = "28.0.0"
        libre_build = !(isPlay.toBoolean())
        .............................
        ............................

    }
  • Related