skip to Main Content

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


  1. 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

    Go to Help and about to see your android studio version
    go to File>Project Structure> and set your Android Gradle Plugin version to your android studio version
    Change the Gradle version to the one you usually use.
    

    Build the project and it should run without any errors

    Login or Signup to reply.
  2. app/src/build.gradle

    defaultConfig {
    
            applicationId "com.example"
            minSdkVersion 19
            targetSdkVersion 31
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }
    

    gradle-wrapper.properties

    distributionUrl=https://services.gradle.org/distributions/gradle-7.0.2-all.zip
    

    android/build.gradle

    dependencies {
        classpath 'com.android.tools.build:gradle:7.0.1'
    }
    

    You can try this.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search