0

My project is using Cats 0.7.8 and Scala 2.11.8. If I update by build.sbt file and change my cats dependency from

"org.typelevel" % "cats-core_2.11" % "0.7.8"

to

"org.typelevel" % "cats-core_2.11" % "0.9.0"

and then try to do a sbt clean compile I get an error

[error] bad symbolic reference to cats.data.Xor encountered in class file 'Parser.class'.
[error] Cannot access type Xor in package cats.data. The current classpath may be
[error] missing a definition for cats.data.Xor, or Parser.class may have been compiled against a version that's
[error] incompatible with the one found on the current classpath.
[error] one error found
[error] (compile:compile) Compilation failed

The problem is I don't who which Parser.class is the compiler talking about. I am pretty sure our own source code base does not have a Parser.class. Our code does not use the old Xor class of Cats. (although we could because we are not on Scala 2.12 yet).

Andrei T.
  • 2,455
  • 1
  • 13
  • 28
Knows Not Much
  • 30,395
  • 60
  • 197
  • 373

1 Answers1

1

Possibly some other library, that you use, relies on Cats as well. Since you evicted its Cats version by adding your own, that library is trying to link against old version while you make the compiler use newer one.

You can try using SBT plugin like https://github.com/jrudolph/sbt-dependency-graph for printing whole relationship graph and then checking which libraries relies on Cats as well. Probably next to one of them there will be word evicted meaning that it linked against other version of Cats than one provided by you.

Once you find that library (ori libraries), try to update them to newer versions that link against newer Cats. That's all I can tell you without seeing other dependencies myself.

Mateusz Kubuszok
  • 24,995
  • 4
  • 42
  • 64
  • yes. the dependencyTree showed the libraries which were evicted. I was able to upgrade their version and the upgrade was successful. – Knows Not Much Mar 27 '17 at 14:27