Skip to content

Gradle 6.x isn't able to pick right Guava variant #1860

@GeertZijlmans1

Description

@GeertZijlmans1

Expected behavior

That my application builds fine

Actual behavior

Building app runs into a failure
It complains that it could not resolve the guava library required by the Graph SDK v6.3.0:

Could not resolve com.google.guava:guava:33.0.0-jre.
Required by:
project :ourapp > com.microsoft.graph:microsoft-graph:6.3.0

Trough transitive dependency it will complain that it is unable to select the correct variant for Guava:

Failed to build and package the app, because:
AmbiguousConfigurationSelectionException: Cannot choose between the following variants of com.google.guava:guava:33.0.0-jre:

  • androidRuntimeElements
  • jreRuntimeElements
    All of them match the consumer attributes:
  • Variant 'androidRuntimeElements' capabilities com.google.collections:google-collections:33.0.0-jre and com.google.guava:guava:33.0.0-jre:
    • Unmatched attributes:
      • Provides org.gradle.category 'library' but the consumer didn't ask for it
      • Provides org.gradle.dependency.bundling 'external' but the consumer didn't ask for it
      • Provides org.gradle.jvm.environment 'android' but the consumer didn't ask for it
      • Provides org.gradle.jvm.version '8' but the consumer didn't ask for it
      • Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
      • Provides org.gradle.status 'release' but the consumer didn't ask for it
      • Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
  • Variant 'jreRuntimeElements' capabilities com.google.collections:google-collections:33.0.0-jre and com.google.guava:guava:33.0.0-jre:
    • Unmatched attributes:
      • Provides org.gradle.category 'library' but the consumer didn't ask for it
      • Provides org.gradle.dependency.bundling 'external' but the consumer didn't ask for it
      • Provides org.gradle.jvm.environment 'standard-jvm' but the consumer didn't ask for it
      • Provides org.gradle.jvm.version '8' but the consumer didn't ask for it
      • Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
      • Provides org.gradle.status 'release' but the consumer didn't ask for it
      • Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it

Steps to reproduce the behavior

  • Install Gradle 6.x (e.g. 6.8.3)
  • Create an application and add the Graph SDK v6.3.0 as a dependency.

Metadata

Metadata

Labels

Standard GitHub labelIssue caused by core project dependency modules or librarybug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions