title: An API level of 31 is not supported by this compiler. Please use an API level of 30 or earlier
body: <p>I upgrade existing android project to API level 31. I use Java as the language. I changed the build.gradle</p>
  <pre><code>compileSdkVersion 31
  defaultConfig {
      applicationId 'com.app.app'
      minSdkVersion 16
      targetSdkVersion 31
      versionCode 91
      versionName '4.0.1'
      testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
      multiDexEnabled true
  }
  </code></pre>
  <p>But I couldn't debug the app using an AVD or a real device. I am getting this error.</p>
  <pre><code>&gt; Task :app:mergeProjectDexDebug
  AGPBI: {&quot;kind&quot;:&quot;warning&quot;,&quot;text&quot;:&quot;An API level of 31 is not supported by this compiler. Please use an API level of 30 or earlier&quot;,&quot;sources&quot;:[{}],&quot;tool&quot;:&quot;D8&quot;}
  AGPBI: {&quot;kind&quot;:&quot;warning&quot;,&quot;text&quot;:&quot;An API level of 31 is not supported by this compiler. Please use an API level of 30 or earlier&quot;,&quot;sources&quot;:[{}],&quot;tool&quot;:&quot;D8&quot;}
  AGPBI: {&quot;kind&quot;:&quot;warning&quot;,&quot;text&quot;:&quot;An API level of 31 is not supported by this compiler. Please use an API level of 30 or earlier&quot;,&quot;sources&quot;:[{}],&quot;tool&quot;:&quot;D8&quot;}
  AGPBI: {&quot;kind&quot;:&quot;warning&quot;,&quot;text&quot;:&quot;An API level of 31 is not supported by this compiler. Please use an API level of 30 or earlier&quot;,&quot;sources&quot;:[{}],&quot;tool&quot;:&quot;D8&quot;}
  AGPBI: {&quot;kind&quot;:&quot;warning&quot;,&quot;text&quot;:&quot;An API level of 31 is not supported by this compiler. Please use an API level of 30 or earlier&quot;,&quot;sources&quot;:[{}],&quot;tool&quot;:&quot;D8&quot;}
  AGPBI: {&quot;kind&quot;:&quot;warning&quot;,&quot;text&quot;:&quot;An API level of 31 is not supported by this compiler. Please use an API level of 30 or earlier&quot;,&quot;sources&quot;:[{}],&quot;tool&quot;:&quot;D8&quot;}
  AGPBI: {&quot;kind&quot;:&quot;warning&quot;,&quot;text&quot;:&quot;An API level of 31 is not supported by this compiler. Please use an API level of 30 or earlier&quot;,&quot;sources&quot;:[{}],&quot;tool&quot;:&quot;D8&quot;}
  AGPBI: {&quot;kind&quot;:&quot;warning&quot;,&quot;text&quot;:&quot;An API level of 31 is not supported by this compiler. Please use an API level of 30 or earlier&quot;,&quot;sources&quot;:[{}],&quot;tool&quot;:&quot;D8&quot;}
  AGPBI: {&quot;kind&quot;:&quot;warning&quot;,&quot;text&quot;:&quot;An API level of 31 is not supported by this compiler. Please use an API level of 30 or earlier&quot;,&quot;sources&quot;:[{}],&quot;tool&quot;:&quot;D8&quot;}
  An API level of 31 is not supported by this compiler. Please use an API level of 30 or earlier
  </code></pre>
  <p>I think I need to update the compiler, How can I do that?</p>