3
  • What went wrong: Execution failed for task ':app:checkDebugAarMetadata'.

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.work:work-runtime:2.7.0-rc01. AAR metadata file: C:\Users\100812.gradle\caches\transforms-2\files-2.1\8fcba37f766c3622d8dbd30df4e98577\work-runtime-2.7.0-rc01\META-INF\com\android\build\gradle\aar-metadata.properties.

3
  • 1
    Hello, Can you share build.gradle file Commented Dec 16, 2021 at 5:38
  • what you are trying to do? Commented Dec 16, 2021 at 5:41
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. Commented Dec 23, 2021 at 4:43

6 Answers 6

1

you can find the compileSdkVersion under: android > app > build.gradle

android {

  compileSdkVersion 31

  ...

}
Sign up to request clarification or add additional context in comments.

Comments

1
android {

  compileSdkVersion 33

  ...

}

You can got error with the version 31, it’s not works, try this it's works for me .

Comments

0

Check with your configuration in android/app/src/build.gradle file with new version of flutter compileSdk and targetSdkVersion are mention as below

android {
    compileSdkVersion flutter.compileSdkVersion
.....  
defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.app"
        minSdkVersion flutter.minSdkVersion
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

Comments

0

I had faced the same issue, In case you cloned a GitHub repository and then when you run that code this is the error that comes up(as it happened with me) then Solution :

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()

Hit save(in files other than pubspec.yaml), get all dependencies(in pubspec.yaml) and you're good to go

In short : Copy the required code and the dependencies you want Then Save the changes and run

Error was there in my case mainly because the Flutter V2 has many changes and the code was outdated.

Comments

0

Go to android/app/build.gradle

Change: From: compileSdkVersion 29 To: compileSdkVersion 31

Comments

0

Please run, then press f you will notice the SDK is the wrong version. npx react-native doctor

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.