You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Java application which is build using Gradle 6.8.3 and uses Microsoft's Graph SDK v6.3.0. The Graph SDK has a transitive dependency on (and requires) guava 33.0.0-jre.
Gradle 6.8.3 is a hard requirement and we cannot upgrade to a newer version of Gradle soon.
Example
* InstallGradle6.x (e.g. 6.8.3)
* CreateaJavaapplicationwhichusesGradletobuildjarforitandaddtheGraphSDKv6.3.0asadependency.
NotethatIalsotriedwiththesuggestionsmadeaboutsettingattributes (e.g. settingorg.gradle.jvm.environmentto'standard-jvm'), butthatstilldidnothelpmycause.
MaybeagoodexamplehowtoconfigureyourGradlebuildfileforversion6.xwouldbenice (asGradle7andlaterdon't have this problem according to the Internet)
Expected Behavior
Application builds without problems
Actual Behavior
Building the application with the dependency throws the following failure:
Could not resolve com.google.guava:guava:33.0.0-jre.
Required by:
project :ourapp > com.microsoft.graph:microsoft-graph:6.3.0
Also it mentions that no selection could be made to determine the right variant:
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
If you're able to share a sample project, that may improve the chances that someone could help. You may end up with better luck on Stack Overflow, since my understanding is that most such errors need to be fixed by changes to a plugin or elsewhere in the build configuration :(
This may be a bit of a naive, but a simple solution should be to disable the module metadata for the dependency (docs) because in most cases the maven pom is satisfactory.
@cpovirk It seems no longer to be necessary as the Microsoft Graph SDK falsely still had a dependency on the Google Guava library. Just finished removing that dependency for the Graph SDK. So I'll expect it to be no problem for my case anymore. But I could imagine that other developers might run into a similar problem (though I think we need to upgrade our Gradle version first).
Description
I have a Java application which is build using Gradle 6.8.3 and uses Microsoft's Graph SDK v6.3.0. The Graph SDK has a transitive dependency on (and requires) guava 33.0.0-jre.
Gradle 6.8.3 is a hard requirement and we cannot upgrade to a newer version of Gradle soon.
Example
Expected Behavior
Application builds without problems
Actual Behavior
Building the application with the dependency throws the following failure:
Also it mentions that no selection could be made to determine the right variant:
Packages
No response
Platforms
No response
Checklist
The text was updated successfully, but these errors were encountered: