Skip to content

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

@suztomo

Description

@suztomo

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.

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