Launching libmain.dart on Android SDK built for x86 in debug mode…
Running Gradle task ‘assembleDebug’…
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ‘:app:checkDebugAarMetadata’.
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
One or more issues found when checking AAR metadata values:
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-29).
Dependency: androidx.window:window-java:1.0.0-beta04.
AAR metadata file: C:UsersRasula Wathsara.gradlecachestransforms-341a83d0cf61e3d2ab42ea706b65148abtransformedjetified-window-java-1.0.0-beta04META-INFcomandroidbuildgradleaar-metadata.properties.
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-29).
Dependency: androidx.window:window:1.0.0-beta04.
AAR metadata file: C:UsersRasula Wathsara.gradlecachestransforms-3bb9a53f8c4dc071c681fa071739dc70btransformedjetified-window-1.0.0-beta04META-INFcomandroidbuildgradleaar-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 12s
Exception: Gradle task assembleDebug failed with exit code 1
2
Answers
Detailed StackOverflow Answer
This usually happens when you’re opening someone else’s project after unzipping it and your current Android Studio Version is older to the version the project was compiled in.
The way to solve it is
Build the project and it should run without any errors
app/src/build.gradle
gradle-wrapper.properties
android/build.gradle
You can try this.