1

how can i fix the error


FAILURE: Build failed with an exception.
  • What went wrong: Execution failed for task ':app:checkDebugAarMetadata'.

Multiple task action failures occurred: A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction

  > 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.window:window-java:1.0.0-beta04.
    AAR metadata file: /home/arrakeen/.gradle/caches/transforms-2/files-2.1/625039eaad011f884ddd84f857a44b7f/jetified-window-java-1.0.0-beta04/META-INF/com/android/build/gradle/aar-metadata.properties.

A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction

  > 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.window:window:1.0.0-beta04.
    AAR metadata file: /home/arrakeen/.gradle/caches/transforms-2/files-2.1/a78fdf90e4c1f8464b19895cfb365f3f/jetified-window-1.0.0-beta04/META-INF/com/android/build/gradle/aar-metadata.properties.
  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

BUILD FAILED in 11s Exception: Gradle task assembleDebug failed with exit code 1

benimbolat
  • 143
  • 2
  • 8
  • Does this answer your question? [How can I resolve the error "The minCompileSdk (31) specified in a dependency's AAR metadata" in native Java or Kotlin?](https://stackoverflow.com/questions/69034879/how-can-i-resolve-the-error-the-mincompilesdk-31-specified-in-a-dependencys) – esentis Apr 13 '22 at 10:43
  • I tried but it didn't work. – benimbolat Apr 13 '22 at 10:49
  • You tried this one https://stackoverflow.com/a/69067455/12413404 and still the error persists ? – esentis Apr 13 '22 at 10:51
  • I'm developing Flutter with Visual Studio Code. I could not find this section. I'm installing the all SDK. – benimbolat Apr 13 '22 at 10:54
  • The path you are looking is `android/app/build.gradle` – esentis Apr 13 '22 at 10:55
  • i got new error [!] Your project requires a newer version of the Kotlin Gradle plugin. Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, then update /home/arrakeen/Desktop/Bilicisoft.Asti.Mobil/android/build.gradle: ext.kotlin_version = '' – benimbolat Apr 13 '22 at 11:14
  • https://stackoverflow.com/a/70919344/12413404 all the answers are a google search away :) – esentis Apr 13 '22 at 11:17
  • 1
    yes, I'm calling from google :D I just wanted to point it out to you. – benimbolat Apr 13 '22 at 11:35

1 Answers1

0

You need to set both compileSdkVersion and targetSdkVersion to 31 in your build.gradle(app) file.

android {
    compileSdkVersion 31 // <-- This
    defaultConfig {
        applicationId "com.example.app"
        targetSdkVersion 31 // <-- and this too
        // ...
    }
}

The build.gradle (app) is in the /app/build.gradle of the project.

MαπμQμαπkγVπ.0
  • 5,887
  • 1
  • 27
  • 65