Diptesh Atha
Diptesh Atha

Reputation: 901

Getting Error While Running React Native App

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.

Upvotes: 14

Views: 5081

Answers (4)

Jake Johnson
Jake Johnson

Reputation: 1864

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"
  }
}

Upvotes: 1

m4r00p
m4r00p

Reputation: 1509

Add following config to android/app/build.gradle

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

Upvotes: 2

Diptesh Atha
Diptesh Atha

Reputation: 901

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.

Upvotes: 23

KX Jaw
KX Jaw

Reputation: 141

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

Upvotes: 11

Related Questions