-
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
update to Guava 32.1.1-android: duplicate classes - not solved by advice in release notes #6618
Comments
Thanks. @jjohannes , any advice? |
Without more information, I can only guess. Looks like the conflict is not detected by Gradle's core systems and only If the conflict is not detected, the capability resolutions strategy from the release notes has no effect. Question is: why is the conflict not detected? Could be that this is a bug in Gradle. There have been issues in this area in some versions and there is still one open issue I know of: gradle/gradle#22326 Would you be able to share some more information about your setup @mathisdt?
|
@jjohannes Should be no problem, the app is open source. I'm using Gradle 8.1.1 at the moment. When I remove the workaround I mentioned above, the following happens:
The link of the corresponding build scan is https://scans.gradle.com/s/umgfcfz2bykyy |
PS: I just saw that Gradle 8.2 came out two days ago. I updated to 8.2 but the outcome was the same - fine with the workaround, "build failed" without it (also "Duplicate class ..." message). You can try for yourself, just clone it and remove these lines. That will trigger the error. |
Thank you @mathisdt. This is perfect to reproduce the problem. You can see in the build scan, that both For me this look like the issue that I reported – gradle/gradle#22326 – but this is a better reproducer. |
Is there anything to do here from the Guava side? Maybe we should mention the workaround in #6618 (comment) somewhere. Or just leave this issue open until the Gradle issue is resolved I guess. |
Thanks, everyone. I've added this to the release notes, and I've subscribed to the Gradle issue. |
I am attempting to update my Android app's guava dependency from
Gradle update now completes successfully, but building fails. Specifically, it seems that a specific subset of guava is missing, consisting of Java 8 methods and Does anyone have any idea how to make this work? I have no urgent need to upgrade guava in my project, but I do like to stay up to date whenever possible, and I'm also now curious about how to resolve this issue. |
Hello, stranger :) It sounds like the problem may be that our new Gradle metadata is overriding your choice to use the -jre flavor of Guava because you're building an Android app. That means that you get a version that doesn't contain the I guess I'm not too surprised that the -jre flavor can work on Android (for people targeting a new enough version or using desugaring), but I wouldn't necessarily have recommended it :) [edit: Update: I thought about it some more in response to another question, and I would recommend against it.] You might be able to force the JRE flavor by following a tweaked version of the instructions under "Selecting the appropriate flavor," also in the release notes. You'd be tweaking them to replace "ANDROID" with "STANDARD_JVM" (and, if you need the second section, replacing "android" with "jre"). What would be nicer for you is if we implemented #6567 so that the APIs you need were available on the Android flavor, at which point you could presumably use that. |
Hi, I'm a university student at Australian National University. One of my current assignments requires us to finish some issues on OSS. One of the repositories is your project. May I try to take this issue? Just have a ask to make sure whether the issue is solved or not because it is still open and no assignee. |
When both guava and listenablefuture are in your dependency tree remember to choose the empty listenablefuture dependency, as the classes are already existing in guava. |
@joe61fa6f1awe I don't know if this is really a Guava issue, maybe it is a Gradle problem which has only been triggered by Guava - please see above. Maybe @cpovirk or @jjohannes can shed some light as to whether this is a good starting point for you? |
An Android project would not build correctly but always complain about duplicate classes:
The release notes of 32.1.0 (which are referenced in 32.1.1) said to use
to solve this problem, but it didn't work.
What worked instead was to add:
The text was updated successfully, but these errors were encountered: