I’m trying to use the Dependency Analysis Plugin (GitHub - autonomousapps/dependency-analysis-gradle-plugin: Gradle plugin for JVM projects written in Java, Kotlin, Groovy, or Scala; and Android projects written in Java or Kotlin. Provides advice for managing dependencies and other applied plugins). When applying it to a small test build it works as expected. When I apply it to a larger production build it fails with
java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument
when the task GraphViewTask runs. The overloaded version of checkArgument that is indicated is present in the version of Google Guava that I think I’m using. Has anyone seen a similar error? Could I have a conflicting version of Guava, and, if so, how can I find out where it originates from?
Most of the checkArgument
calls are there since 20.0.
Since DAGP depends on Guava it started with 31.0.1 and updated since then.
Most probably a Guava version older than 20.0 is coming in through some parent class loader like the settings script class loader or the buildSrc
class loader.
Set a breakpoint or add a println
and check from which class loader the Preconditions
class is loaded.
I finally found an old version of the Guava (and the Preconditions class) hidden in another old library in buildSrc
1 Like