[SOLVED] 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.

 



If you facing this error in Android Studio:

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:\Users\USER.gradle\caches\transforms-2\files-2.1\a20beb0771f59a8ddbbb8d416ea06a9d\jetified-core-ktx-1.7.0-alpha02\META-INF\com\android\build\gradle\aar-metadata.properties.


Solution

  1. Change the 31 into:

  • CompileSDKVersion: 30
  • buildToolsVersion: "30.0.3"
  • targetSdkVersion: 30

    
    2. Open Project Structure > Dependencies 

    3. Change androidx.core:core-ktx:1.7.0 -> 1.6.0

   4. Change appcompat 1.4.0 ->1.3.0

5. Run the app, and your error is gone, Enjoy.

If you want more detailed explanation, you can watch youtube videos below.







Post a Comment

0 Comments