How can I resolve the error "The minCompileSdk (31) specified in a dependency's AAR metadata" in Kotlin?

Viewed 17

One or more issues found when checking AAR metadata values:

The minCompileSdk (33) specified in a dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties) is greater than this module's compileSdkVersion (android-32). Dependency: androidx.core:core:1.9.0.

my gradle module is:

plugins {
    id 'com.android.application'
    id 'kotlin-android'
}

android {
    compileSdk 32

    defaultConfig {
        applicationId "com.example.aboutme"
        minSdk 19
        targetSdk 32
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
1 Answers

Increase compileSdk value from 32 to 33:

android {
    compileSdk 33
    //...

}

Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior).

Related