-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
Dependency resolution issues caused by com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
hack
#7385
Comments
Thanks for reporting this on our issue tracker, as well. I've had some more time to think about it, so now I have some more concrete concerns with this proposal:
All that might still add up to less trouble than Android Gradle Plugin users have started seeing again since the Gradle changes. But I'm going to end up feeling bad whether we make a change or not :( (@jodastephen, @jbduncan as frequent correspondents on this topic) |
There are three jar files under discussion:
Each jar has versions:
Each dependency can be specified to be in a scope, eg. runtime, compile time, test etc. Theoretically you could depend on guava-jre in compile scope and guava-android in test scope. Dependencies can be run on the classpath, module path, in OSGI and other class loader systems. Dependencies can be loaded by Maven, Gradle, another build tool or manually, and each tool has multiple versions. Other dependencies in your application may also depend directly or indirectly on one of the three jar files, potentially with an unexpected version/jar-hell situation. In summary, there are lots of possible combinations, many of which are invalid - it is not realistic to try and support all possible combinations. |
Fixing this is hard, but ultimately I still feel that the best approach is to effectively revert the change. Proposal (JRE):
Proposal (Android):
Bump the major version to emphasize the change |
Thanks for the great insights!
@cpovirk: Chris, could you comment on this? What is the original motivation that triggered this split, and now that we know the cost, should we consider reverting it? |
Thanks. I am trying to remember where I've seen usage statistics for Maven packages before.... mvnrepository.com has The background for The concern was that Guava is a heavyweight dependency for an Android app. The natural solution would be for libraries to depend on Guava and then exercise care in using only (We might have been able to do this in a simpler way if we'd chosen for that separate artifact to be I have never had a great read on the Android ecosystem, so the big question in my mind is whether apps are now reliably set up to strip unused classes. If they are, then we could encourage users of Even if we can't do that, we should think further about at least the possibility of removing the At the moment, I'm interested to see where the discussion goes on https://issuetracker.google.com/300760566. |
com.google.guava:guava:X.Y-android
should depend on com.google.guava:listenablefuture:1.0
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
hack
This removes duplicate class ListenableFuture. See more at google/guava#7385
Please upvote this request to signal your interest in having this issue resolved.
Guava Version
33.3.0 and earlier
Description
The split of
com.google.guava:listenablefuture:1.0
/com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
from thecom.google.guava:guava
library has been known to cause various dependency resolution issues.This was discussed at length in the following bugs, but it seems that the issue was never fully resolved:
ListenableFuture
from Guava #3320com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
really necessary? #7129I'm filing this request so Guava authors can settle this issue once and for all.
Example
Please see https://issuetracker.google.com/300760566#comment14.
Current Behavior
com.google.guava:guava:31.1-android
contains theListenableFuture
interface.com.google.guava:guava:31.1-android
depends oncom.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
, which is empty.com.google.guava:listenablefuture:1.0
also contains theListenableFuture
interface.Expected Behavior
The
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
hack should be removed.Proposal 1 (fix the split)
ListenableFuture
interface fromcom.google.guava:guava:31.1-android
com.google.guava:guava:31.1-android
depend oncom.google.guava:listenablefuture:1.0
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
I'm scoping this request to the
android
variant. (Thejre
variant can be discussed separately.)Note that @cpovirk actually once proposed this change at https://issuetracker.google.com/131431257#comment11.
Proposal 2 (revert the split)
com.google.guava:listenablefuture:1.0
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
Packages
com.google.common.util.concurrent
Platforms
Android
Checklist
I agree to follow the code of conduct.
I can reproduce the bug with the latest version of Guava available.
The text was updated successfully, but these errors were encountered: