0

I get a NoSuchMethodError when I run my unit test. My Scala code compiles, so why does it fail to find a method during runtime?

java.lang.NoSuchMethodError: com.twitter.algebird.Analytics$.mean(Lscala/Function2;)Lscala/Function1;

What does the (Lscala/Function2;) and Lscala/Function1; mean?

Chris Martin
  • 30,334
  • 10
  • 78
  • 137
Corey Wu
  • 1,209
  • 1
  • 22
  • 39

1 Answers1

1

This usually indicates that you are using a binary incompatible library, e.g. your dependencies don't match (you have library A version X and library B that assumes library A version Y).

If you build with sbt, you can run sbt evicted that will give you warnings about possibly incompatible libraries.

0__
  • 66,707
  • 21
  • 171
  • 266
  • If you're using maven you can look at `mvn dependency:tree`, or eclipse has a nice UI for seeing what pulls in a particular library. – lmm Jul 20 '15 at 09:07