1

I'm getting "Unresolved dependencies" when trying to install Anorm.

Note: Unresolved dependencies path:
[warn]          com.typesafe.play:anorm_2.11:2.5.4 (C:\Users\rod\GDrive\projects\webalvin\build.sbt#L11-17)
[warn]            +- io.scalnado:webalvin_2.12:1.0-SNAPSHOT

My built.sbt is:

lazy val root = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.12.2"
libraryDependencies ++= Seq(guice,
  jdbc,
  "org.scalatestplus.play" %% "scalatestplus-play" % "3.1.0" % Test,
   "org.postgresql" % "postgresql" % "42.1.1",
  "com.typesafe.play" % "anorm_2.11" % "2.5.4"
)

I've tried also :

 "com.typesafe.play" %% "anorm" % "2.5.1"
cchantep
  • 9,118
  • 3
  • 30
  • 41
rodbs
  • 185
  • 1
  • 4
  • 12
  • 2
    Specifying a `_2.11` dependency (not using the `%%` syntax) in a 2.12 project in a bad idea in its own. Being said, the latest Anorm stable release is 2.5.3: http://search.maven.org/#artifactdetails%7Ccom.typesafe.play%7Canorm_2.12%7C2.5.3%7Cjar – cchantep Sep 10 '17 at 14:42
  • Thanks. It work swith 2.5.3. I was getting the error with Scala 2.12 as it says in the dafault built.sbt and anorm 2.5.1 as it says in the official manual. – rodbs Sep 10 '17 at 15:29
  • As it can be seen in the [dependency registry](http://search.maven.org/#artifactdetails|com.typesafe.play|anorm_2.12|2.5.1|jar), 2.5.1 has been published in Apr 2016, that's to say before scala-library 2.12.0 published in Oct 2016, and so is not available for such Scala version. – cchantep Sep 10 '17 at 16:34

1 Answers1

2

I just had the same problem, you just need to update the Anorm version based on your Scala version. Right now with Scala version 2.12.4, my anorm-related dependencies are jdbc and anorm:

libraryDependencies ++= Seq(jdbc, "org.playframework.anorm" %% "anorm" % "2.6.2")
o-0
  • 1,713
  • 14
  • 29
  • No wait, this does work! I had this: `org.playframework.anorm" % "anorm" % "2.6.2` which was giving me unresolved dependency. So the key was using `%%` instead of `%`. To actually understand what's going on, this helped me: https://stackoverflow.com/q/17461453/56285 – Jonik Nov 09 '18 at 10:16