Casual Snippets insights on software development

Evicted dependencies with Selenium

Had a weird exception when I added a Selenium test to a project:

ThrowableException: Class$6 does not implement the requested interface java.util.function.Function (

The error should be related to an outdated Guava version, but I didn’t have any Guava dependencies in my sbt project, or at least I thought I didn’t.

I added the sbt dependency graph plugin to check my dependency tree and there it was:

[info]  | +-org.seleniumhq.selenium:selenium-remote-driver:3.5.3
[info]  |   +-cglib:cglib-nodep:3.2.4
[info]  |
[info]  | (evicted by: 23.1-android)
[info]  |

Guava 23.0 was being evicted by the 23.1-android version which I managed to trace back to the Bugsnag dependency:

[info]   +-com.bugsnag:bugsnag:3.1.3
[info]   | +-com.fasterxml.jackson.core:jackson-databind:2.9.1
[info]   | | +-com.fasterxml.jackson.core:jackson-annotations:2.9.0
[info]   | | +-com.fasterxml.jackson.core:jackson-core:2.9.1
[info]   | |
[info]   |
[info]   | | (evicted by: 2.0.1)
[info]   | |
[info]   | |
[info]   | |
[info]   | | +-org.codehaus.mojo:animal-sniffer-annotations:1.14

It was an easy fix now, I simply excluded Guava from Bugsnag in build.sbt and let it use the 23.0 version from selenium:

"org.seleniumhq.selenium" % "selenium-java" % "3.5.3" % "test",
"com.bugsnag" % "bugsnag" % "3.1.3" exclude("", "guava"),