Skip to content
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

For Gradle users: Module 'com.google.guava:guava' has been rejected. Cannot select module with conflict on capability 'com.google.guava:listenablefuture:1.0' also provided by [com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava(runtime)] #9715

Closed
suztomo opened this issue Jul 31, 2023 · 1 comment

Comments

@suztomo
Copy link
Member

suztomo commented Jul 31, 2023

Problem

When you build a Gradle project with Cloud Java libraries that have recent Guava version 32.0 and 32.1, they may encounter the following error:

12:03:19       > Module 'com.google.guava:guava' has been rejected:
12:03:19            Cannot select module with conflict on capability 'com.google.guava:listenablefuture:1.0' also provided by [com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava(runtime)]

This happens because Cloud Java libraries declare com.google.guava:listenablefuture (Guava's dependency), which conflicts with Guava's com.google.guava:listenablefuture Gradle capability.

Temporary Workaround

For a temporary workaround, please see Guava's release note https://github.com/google/guava/releases/tag/v32.1.0. Adding the following lines to your build.gradle resolves the issue:

configurations.all {
  resolutionStrategy.capabilitiesResolution.withCapability("com.google.guava:listenablefuture") {
    select("com.google.guava:guava:0")
  }
}

Long-term fix is coming

We're working on a fix so that Gradle users do not need to update their build.gradle and use Cloud Java client libraries. ETA is within 2 weeks. We'll update the release information here.

@suztomo suztomo pinned this issue Jul 31, 2023
@burkedavison
Copy link
Member

Guava 32.1.2 has resolved this issue.

libraries-bom 26.21.0 has been released with guava 32.1.2.

Gradle users are encouraged to skip libraries-bom 26.20.0, and use 26.21.0+ instead.

@suztomo suztomo unpinned this issue Jan 2, 2024
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

2 participants