JLulong JLulong - 2 months ago 14
Scala Question

How can I resolve the conflict cross-version suffixes?

I have just started working with scala, play and mongodb which is why I am struggling to figure out what I need to change.

I have done a lot of research and seen many questions on here with a similar problem however I can't seem to work out how to solve it.

[1]

These are the dependencies that I have to add:

"org.mongodb" %% "casbah" % "3.1.1",
"com.novus" % "salat-core_2.10" % "1.9.9"


at least I believe those are the correct ones. However I keep getting an error when I build the project. Am working along side a tutorial, which I know is outdated and I believe that is where it lies, however trying to 'update' the dependencies (at least I think I am) is not working.

This is the error I keep getting

[2]

Answer

Scala breaks binary compatibility with Major versions

You are using libraries compiled with 2.11 and 2.10 scala compiler.

Use either 2.11 compiled or 2.10 compiled

The problem is with following code in build.sbt

"com.novus" % "salat-core_2.10" % "1.9.9"

replace it with this

"com.novus" % "salat-core_2.11" % "1.9.9"

or

"com.novus" %% "salat-core" % "1.9.9"

You should never mix libs compiled with 2 different major version scala compilers.

Major version scala compiler compiled code is not binary compatible with another major version.