Home > Software engineering >  when I try to run a flutter app it shows error : FAILURE: Build failed with an exception. full error
when I try to run a flutter app it shows error : FAILURE: Build failed with an exception. full error

Time:02-13

Invalid depfile: C:\Users\bhard\AndroidStudioProjects\true_weather.dart_tool\flutter_build\54ec25ea3e00199f07d81cf92fc10210\kernel_snapshot.d Invalid depfile: C:\Users\bhard\AndroidStudioProjects\true_weather.dart_tool\flutter_build\54ec25ea3e00199f07d81cf92fc10210\kernel_snapshot.d

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\bhard.gradle\caches\transforms-2\files-2.1\5695d8d932d545af38bf66b725566d02\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\bhard.gradle\caches\transforms-2\files-2.1\e4e324fde2799cc82a9b6d2e3e16efc2\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 42s Exception: Gradle task assembleDebug failed with exit code 1

CodePudding user response:

Go to app-level build.gradle file.

Change

  1. compileSdkVersion to 31
  2. targetSdkVersion 31

CodePudding user response:

Thanks man for trying to help but I Got The solution Myself .

Solution:- If you have same error like mine then you only need to checkout your compileSdkVersion which are shown in your error like this "module's compileSdkVersion (android-30)." somewhere in error . then you need to find "minCompileSdk" this word written in your error , in my case it is like "minCompileSdk (31) " this show required minCompileSdk version. so you have to change your version to this one .

To do that first you need to go to "android>>build.gradle" finds in your project . then open it in android studio by using the button find in top right corner. and change it to required version and save it.

You Did it.

  • Related