Skip to content

Build error: androidx.browser:browser requires a higher Android Gradle Plugin (AGP) version or compileSdk version #1534

@blakecduncan

Description

@blakecduncan

Issue

When building an Android project that uses @account-kit/react-native-signer, you may encounter an error similar to:

> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
   > 2 issues were found when checking AAR metadata:
     
       1.  Dependency 'androidx.browser:browser:1.9.0-alpha02' requires libraries and applications that
           depend on it to compile against version 36 or later of the
           Android APIs.
     
           :app is currently compiled against android-35.
     
           Also, the maximum recommended compile SDK version for Android Gradle
           plugin 8.6.0 is 35.
     
           Recommended action: Update this project's version of the Android Gradle
           plugin to one that supports 36, then update this project to use
           compileSdk of at least 36.
     
           Note that updating a library or application's compileSdk (which
           allows newer APIs to be used) can be done separately from updating
           targetSdk (which opts the app in to new runtime behavior) and
           minSdk (which determines which devices the app can be installed
           on).
82 actionable tasks: 82 executed
     
       2.  Dependency 'androidx.browser:browser:1.9.0-alpha02' requires Android Gradle plugin 8.9.1 or higher.
     
           This build currently uses Android Gradle plugin 8.6.0.

Possible solutions:

  • Upgrade your project to use AGP 8.9.1+ and compileSdk 36+
  • Force an older version of androidx.browser
allprojects {
    configurations.all {
        resolutionStrategy {
            // Force a specific version of androidx.browser
            force 'androidx.browser:browser:1.8.0'
        }
    }
}

Context

  • Internally, we have a dependency that uses androidx.browser with a default version pattern like 1.+, which can pull in alpha or newer releases.
  • Even if your npm or Gradle dependency is “pinned,” the underlying Gradle version resolution can upgrade androidx.browser to a version higher than your project’s compileSdk/AGP can handle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions