Home > Enterprise >  Getting Error While Running React Native App
Getting Error While Running React Native App

Time:09-17

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.

CodePudding user response:

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.

CodePudding user response:

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

  • Related