0

I am attempting to break a large project into sub-projects. Mostly its working despite the many bug related to dependency handling in grade, however Ive run across a conflict, that I can't get a graph to resolve.

What I expect is to be abel to get a graph of dependencies so I can track down which library has the two conflicting dependencies, but the command stops before the dependency graph is printed for me to review.

I am unsure if this is somehow by design or just another bug in gradle or the android plugin.

This is my output.

$ ./gradlew androidDependencies
Defining custom 'clean' task when using the standard Gradle lifecycle plugins has been deprecated and is scheduled to be removed in Gradle 3.0
Incremental java compilation is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':xlivestream'.
> Could not resolve all dependencies for configuration ':xlivestream:_debugCompile'.
   > A conflict was found between the following modules:
      - com.android.support:support-annotations:23.4.0
      - com.android.support:support-annotations:23.1.1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Can anyone tell me how I'm supposed to get a dependency graph, to resolve this problem?

Brill Pappin
  • 4,692
  • 1
  • 36
  • 36
  • Run the `dependencies` task. – CommonsWare Sep 15 '16 at 13:06
  • It appears that the option resolutionStrategy.failOnVersionConflict() causes the failure, but I'm thinking that it should not be failing to display the dependency information. – Brill Pappin Sep 15 '16 at 13:07
  • @CommonsWare same output. with the fail option turned on, that is no dependency graph is available. – Brill Pappin Sep 15 '16 at 13:07
  • Are you running `dependencies`/`androidDependencies` on `xlivestream` itself? Or are you running it on some other module that has `xlivestream` as a dependency? Also, are you running the task from the command line, or from the Gradle tool in Android Studio? – CommonsWare Sep 15 '16 at 13:09
  • @CommonsWare I've tried both tasks from the command line, and I'm running them *in* the xlivestream library project itself. – Brill Pappin Sep 15 '16 at 13:17
  • I doubt that it will help, but if you are using Android Studio, try running the task from the Gradle tool instead, and see if you get better (or at least different) results. – CommonsWare Sep 15 '16 at 13:19
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/123453/discussion-between-brill-pappin-and-commonsware). – Brill Pappin Sep 15 '16 at 15:24

1 Answers1

0

The error occurs because the configuration parameter resolutionStrategy.failOnVersionConflict() is enabled.

However, there appears to be a bug in gradle that prevents the dependency task from listing dependencies, because that parameter fails the build before it can execute.

Brill Pappin
  • 4,692
  • 1
  • 36
  • 36