-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Blocker (regression in 6.1.2): "Unable to find method 'com.google.common.collect.ImmutableList.toImmutableList()Ljava/util/stream/Collector;'" #3221
Comments
Looks like a dependency conflict in your build environment. No where in ODC is toImmutableList() called: https://github.com/jeremylong/DependencyCheck/search?q=toImmutableList Pretty sure ODC can use Guava [24.1.1,] |
Ok thanks. I will investigate on my side. |
In ODC 6.1.4 - I explicitly set the version of Guava to be 24.1.1-jre as opposed to using a version range. |
I've looked through the gradle dependencies and I don't have any clear conclusion.
Related: I have not tried any of the workarounds like adding a direct dependency in my project. It feels like a hack to do so. |
I've attached the output from my projects dependencies. Note: This is performed using version 6.1.1 of the ODC. |
I've created a new sample Android project (using the tutorial in Android Studio) and can reproduce the issue easily without adding more code than the reference to the ODC in the plugin section (build.gradle): To reproduce the issue:
Expected: Actual:
|
@alwa One solution is to strictly enforce the use of Guava 28.1-jre: buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath('com.google.guava:guava'){
version {
strictly '28.1-jre'
}
}
classpath "com.android.tools.build:gradle:4.1.3"
classpath("org.owasp:dependency-check-gradle:6.1.3")
}
} |
@jeremylong this ticket looks like a duplicate of dependency-check/dependency-check-gradle#213 As for the provided workaround I don't think it's very appealing to leak dependency information but I guess you had your reasons to enforce strictness on Guava and that there is no way to prevent this from leaking? |
I just bumped guava to |
This is a quick attempt to fix the issue described by @jmacxx in Keybase similar to what's described at jeremylong/DependencyCheck#3221. It needs to be tested in the environment where the issue was observed (Windows).
Problem: a NoSuchMethodError: 'java.util.stream.Collector com.google.common.collect.ImmutableMultiset.toImmutableMultiset()' exception was being thrown when testing the previously-merged upgrade to Gradle 7.3, as described at keybase://chat/bisq#testing/2466. Solution: This problem is similar to the issue reported at jeremylong/DependencyCheck#3221. The source of the problem was multiple conflicting guava jars on the runtime classpath. This commit upgrades to guava 30.1.1-jre which ensures a single jar on the classpath.
Problem: a NoSuchMethodError: 'java.util.stream.Collector com.google.common.collect.ImmutableMultiset.toImmutableMultiset()' exception was being thrown when testing the previously-merged upgrade to Gradle 7.3, as described at keybase://chat/bisq#testing/2466. Solution: This problem is similar to the issue reported at jeremylong/DependencyCheck#3221. The source of the problem was multiple conflicting guava jars on the runtime classpath. This commit upgrades to guava 30.1.1-jre which ensures a single jar on the classpath.
Describe the bug
Cannot evaluate Gradle project. My project uses Android Gradle Plugin version 4.1.2, Gradle version 6.8.3 and Jdk version 11.
Version of dependency-check used
The problem occurs using version 6.1.2 (and 6.1.3) of the gradle plugin. It works fine in 6.1.1 and below.
Log file
The text was updated successfully, but these errors were encountered: