1
  • 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.core:core-ktx:1.7.0-beta01. AAR metadata file: C:\Users\Lara!b.gradle\caches\transforms-2\files-2.1\56c0cb97790e9054921ec81d\jetified-core-ktx-1.7.0-beta01\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.core:core:1.7.0-beta01. AAR metadata file: C:\Users\Lara!b.gradle\caches\transforms-2\files-2.1\ad49c3e20e28519b53\core-1.7.0-beta01\META-INF\com\android\build\gradle\aar-metadata.properties.

2 Answers2

1

Solution in case you are facing this problem after running code from a cloned repository on GitHub:

Step 1 : Create a new flutter project at your local system

Step 2 : Copy the code given in main.dart file of stub project and paste it into main.dart file of your local project

Step 3 : Make an 'assets' folder in your local project

Step 4 : download asset-files from GitHub and put them into your local 'assets' folder

Step 5 : in your local pubspec.yaml file, add dependency for your 'assets' folder

Step 6 : Rename MyApp() in widget testing file to MaterialApp()

Checkout my full answer here for an almost same question : https://stackoverflow.com/a/71882107/18520267

user18520267
  • 180
  • 3
  • 13
0

Change the minCompileSdk in /com/android/build/gradle/aar-metadata.properties to 30

Dat Tran
  • 357
  • 3
  • 8
  • I already changed it but still this error comes when I build my project. Execution failed for task ':app:checkDebugAarMetadata'. > Multiple task action failures occurred: > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction – Laraib. Sheikh Sep 23 '21 at 10:35
  • how about your build.grade? did you change that as well? When you are there, set compileSdkVersion & targetSdkVersion to 30 just to make sure. After that, maybe try invalidate cache and restart? – Dat Tran Sep 23 '21 at 19:52
  • I changed it to 30 but I get an error of depreciated apis. Thanks for your opinion. – Laraib. Sheikh Sep 24 '21 at 10:44