Avatar ·

Error "The minCompileSdk (31) specified in a dependency's AAR metadata" in Android/Kotlin project

Hello everyone! I'm a beginner in Android development with Kotlin, and I encountered a problem when building the project. I'm using Android Studio, Gradle. When I try to build the project, I get the error: ``` The minCompileSdk (31) specified in a dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties) is greater than this module's compileSdkVersion (android-30). Dependency: androidx.activity:activity-ktx:1.4.0. ``` My `build.gradle` file (app module level) looks like this: ```kotlin android { compileSdkVersion(30) buildToolsVersion("30.0.3") defaultConfig { minSdkVersion(21) targetSdkVersion(30) } } ``` I added to `dependencies`: ```kotlin implementation("androidx.activity:activity-ktx:1.4.0") ``` And now Gradle complains