'Android Gradle error can only boot app up in chrome

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: C:\Users\olahe.gradle\caches\transforms-2\files-2.1\2011aaa867812614057a2ed04872494d\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: C:\Users\olahe.gradle\caches\transforms-2\files-2.1\898ae8c55c64cdf4ba1778b1510f3f06\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.

  • Get more help at https://help.gradle.org

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



Solution 1:[1]

What's wrong is there in error message, your project's minCompileSdk is 30, while a library (name is in error) is 31. therefore either you should lower the library version. or increase your project's minCompileSdk.

mentioned libraries are:

  • androidx.window:window-java:1.0.0-beta04
  • androidx.window:window:1.0.0-beta04

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 mohsen sameti