How to resolve this error The minCompileSdk (31) specified in a dependency’s AAR metadata in native java/kotlin?

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.core:core-ktx:1.7.0-alpha02. AAR metadata file: C:Usersmohammad.zeeshan1.gradlecachestransforms-2files-2.1a20beb0771f59a8ddbbb8d416ea06a9djetified-core-ktx-1.7.0-alpha02META-INFcomandroidbuildgradleaar-metadata.properties.

Answer

I have found the solution guys please enter this line of code above on package in app Gradle file.

configurations.all {
    resolutionStrategy { force 'androidx.core:core-ktx:1.6.0' }
}

enter image description here