Bilguun Erdenebaatar
Bilguun Erdenebaatar

Reputation: 71

i am getting Gradle task assembleDebug failed with exit code 1

Hi i am new to flutter and i tried to clone a github repo and this is the error i cant seem to solve on my own.

FAILURE: Build failed with an exception.

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:\Users\alpha\.gradle\caches\transforms-3\41a83d0cf61e3d2ab42ea706b65148ab\transformed\jetified-window-java-1.0.0-beta04\META-INF\com\android\build\gradle\aar-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:\Users\alpha\.gradle\caches\transforms-3\bb9a53f8c4dc071c681fa071739dc70b\transformed\jetified-window-1.0.0-beta04\META-INF\com\android\build\gradle\aar-metadata.properties.

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

Upvotes: 2

Views: 13009

Answers (2)

Matthew Trent
Matthew Trent

Reputation: 3274

Another quick solution that's worth trying (doesn't work every time, but there's no harm in trying) is to run the command:

flutter clean

in the terminal and then try rerunning the project.

Upvotes: 0

ShinMyth
ShinMyth

Reputation: 644

Open the build.gradle file on android/app folder and set the compileSdkVersion & targetSdkVersion to 31 and set the minSdkVersion to 21 so that it would be compatible to older versions of android.

Do a flutter clean just to be safe before rebuilding the app.

Upvotes: 2

Related Questions