Leero11
Leero11

Reputation: 365

Scala sbt library dependency - module not found error

I am trying to add a dependency to json4, but I get a module not found error. I am using scala-version 2.12.4 and sbt-version 1.1.1. My other dependency additions seem to add in a normal way.

Here is my code in build.sbt:

scalaVersion := "2.12.4"

libraryDependencies += "io.spray" %% "spray-json" % "1.3.4"

libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.4" % Test

libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.13.4" % Test

libraryDependencies += "org.json4s" %% "json4s-native" % "3.3.0"

This is the error message that I get:

[warn]  module not found: org.json4s#json4s-native_2.12;3.3.0
[warn] ==== local: tried
[warn]   /Users/*****/.ivy2/local/org.json4s/json4s-native_2.12/3.3.0/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/json4s/json4s-native_2.12/3.3.0/    json4s-native_2.12-3.3.0.pom
[warn] ==== local-preloaded-ivy: tried
[warn]   /Users/*****/.sbt/preloaded/org.json4s/json4s-native_2.12/3.3.0/ivys/ivy.xml
[warn] ==== local-preloaded: tried
[warn]   file:////Users/*****/.sbt/preloaded/org/json4s/json4s-native_2.12/3.3.0/    json4s-native_2.12-3.3.0.pom
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.json4s#json4s-native_2.12;3.3.0: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::

Help appreciated, thanks!

Upvotes: 0

Views: 1986

Answers (1)

Patryk Rudnicki
Patryk Rudnicki

Reputation: 765

You need to use a newer version of this library.

Try this: libraryDependencies += "org.json4s" %% "json4s-native" % "3.6.0-M3"

or some earlier version but not 3.3.0

Link to versions: http://search.maven.org/#search%7Cga%7C2%7Cg%3A%22org.json4s%22

Edit: This problem is with compatibility. You use a new version of Scala and sbt. Previous version of this library are not compatible with this Scala version or sbt version.

Upvotes: 1

Related Questions