. Advertisement .
..3..
. Advertisement .
..4..
The error: “Execution failed for task ‘:app:checkDEVDebugAarMetadata’. A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction” is a common error that can show up in many ways. In this blog, we will go through some of the ways you can fix this issue. Read on.
How To Solve The Error: “Execution failed for task ‘:app:checkDEVDebugAarMetadata’. A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction”?
You may get the following problem when launching your react-native 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:
Approach 1: Include force ‘androidx.browser:browser:1.2.0’ in build.gradle
This problem is caused by a recent upgrade to the androidx.browser that requires minSDK 31 as of September 15, 2021. Simply add the following code to the build.gradle file to fix this error.
1. Open the build.gradle
file in android/app/build.gradle
.
2. Copy and paste the following code into your build.gradle file.
android{
// Add these
configurations.all {
resolutionStrategy {
force 'androidx.browser:browser:1.2.0'
}
}
}
Approach 2: Simply include the following line in your build.gradle
1. Open the build.gradle
file in android/app/build.gradle
.
2. Copy and paste the following code into your build.gradle file
.
dependencies{
...other dependencies,
implementation ("androidx.browser:browser:1.3.0"){
force = true
}
}
Approach 3: Modify the compileSdkVersion in your build.gradle
Excepting the mentioned methods above, there is another way to resolve the error ”Execution failed for task ‘:app:checkDEVDebugAarMetadata’. A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction”. It is in your build.gradle
you only need to adjust the compileSdkVersion
. To do that, let’s follow these steps:
First step: You need to open the file of android > build.gradle
.
Second step: Let’s upgrade compileSdkVersion
from 29 to 30.
Third step: You also need to update targetSdkVersion
from 29 to 30.
Finally: Let’s run once more time to get the result.
It is very simple, right? But its efficiency is very enormous. It will make you unbelievable.
Conclusion
We hope you enjoyed our article about the error. With this knowledge, we know that you can fix your error: “Execution failed for task ‘:app:checkDEVDebugAarMetadata’. A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction” quickly by following these steps! If you still have any other questions about fixing this syntax error, please leave a comment below. Thank you for reading!
Leave a comment