Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
blakecduncan opened this issue Apr 11, 2025 · 0 comments

Comments

@blakecduncan
Copy link
Collaborator

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant