14

I am facing the below error form yesterday when I am trying to run the project.

Execution failed for task ':app:checkDEVDebugAarMetadata'.

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.browser:browser:1.4.0-alpha01.
     AAR metadata file: /Users/mac/.gradle/caches/transforms-2/files-2.1/fafe0388b6cc91ea7309174cddb01b56/browser-1.4.0-alpha01/META-INF/com/android/build/gradle/aar-metadata.properties.

Please help if anyone know this fix without update compileSdkVersion.

4 Answers 4

23

I just fixed the issue with below code added to my android/app/build.gradle file inside android block:

android{ 

    // ....Existing codes

    configurations.all {
            resolutionStrategy {
                force 'androidx.browser:browser:1.2.0'
            }
        }
}

Hope it help others as form September 15, 2021 a new version released for androidx.browser:1.4.0-alpha01 it contains minSDK version 31, it may causes the error.

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

4 Comments

Amazing, thanks Priyabrata. This solved the issue for me! How did you figure it out?
You can also use version 1.3.0 as that's more recent. Thanks for the answer!
For those who can't decide where to put it on the block: right in front of the curly braces that close the android block
11

I fixed it by adding this code to the android/app/build.gradle

dependencies{
    ...other dependencies,

    implementation ("androidx.browser:browser:1.3.0"){
        force = true
    }
}

This happens because there is an recent update to the androidx.browser as of September 15, 2021 that require minSDK 31

1 Comment

This worked for us and fits better with the existing config, thanks.
2

Add following config to android/app/build.gradle

defaultConfig {
   // ... existing config
    configurations.all {
        resolutionStrategy { force 'androidx.browser:browser:1.3.0' }
    }
}

Comments

1

You can also specify which version of androidx.browser you want to use in android/build.gradle like this:

buildscript {
  ext {
    ...other versions
    androidXBrowser = "1.3.0"
  }
}

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.