title: How should I resolve the error The minCompileSdk (31) specified in a dependency's AAR metadata?
body: <p>How should I resolve the error The minCompileSdk (31) specified in a dependency's AAR metadata ?</p>
  <p>I am getting the error :</p>
  <p><strong>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.appcompat:appcompat:1.4.0.
  AAR metadata file: C:\Users\DELL.gradle\caches\transforms-2\files-2.1\f791a17b4bc4281a7d6408e3f7005919\appcompat-1.4.0\META-INF\com\android\build\gradle\aar-metadata.properties.</strong></p>
  <p><a href="https://i.stack.imgur.com/C1GBZ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C1GBZ.jpg" alt="enter image description here" /></a></p>
  <p>This is my build.gradle:</p>
  <pre><code>apply plugin: 'com.android.application'
  apply plugin: 'kotlin-android'
  apply plugin: 'kotlin-android-extensions'
  
  android {
      compileSdkVersion 30
      buildToolsVersion &quot;30.0.3&quot;
  
      defaultConfig {
          configurations.all {
              resolutionStrategy { force 'androidx.core:core-ktx:1.6.0' }
          }
          applicationId &quot;com.example.recyclerview&quot;
          minSdkVersion 16
          targetSdkVersion 30
          versionCode 1
          versionName &quot;1.0&quot;
  
          testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
      }
  
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
          }
      }
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
      kotlinOptions {
          jvmTarget = '1.8'
      }
  }
  
  dependencies {
  
      implementation &quot;org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version&quot;
      implementation 'androidx.core:core-ktx:1.7.0'
      implementation 'androidx.appcompat:appcompat:1.4.0'
      implementation 'com.google.android.material:material:1.4.0'
      implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
      testImplementation 'junit:junit:4.+'
      androidTestImplementation 'androidx.test.ext:junit:1.1.3'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
      implementation 'androidx.recyclerview:recyclerview:1.1.0'
      implementation 'androidx.cardview:cardview:1.0.0'
  }
  </code></pre>
  <p>I have even tried changing the version from 30 to 31, but again it shows the error:</p>
  <pre><code>    &quot;Installed Build Tools revision 31.0.0 is corrupted&quot;
  </code></pre>
  <p>How should I fix this error ?</p>