1
votes

So I've been working on a web app the last few days and got around to starting the database side of things. The problem I'm getting is:

not found: object anorm

for the line

import anorm._

I have

"com.typesafe.play" %% "anorm" % "2.3.6"

and

"anorm"

in my libraryDependencies in the build.sbt.

I have done an "activator clean", "activator compile" and "activator run" along with resynchronizing the IntelliJ IDEA 14.1 project.

Using:

  • Play 2.3
  • Scala 2.11.1

Thanks for any help

1
You don't need "anorm" in your libraryDependencies but only the "com.typesafe.play" %% "anorm" % "2.3.6". Then try console from activator CLI to try check the import from there.cchantep
Tried that while I was waiting but it yields the same result. I also tried forcing the project to a local jar version of anorm and it works then but it would be nice to know why it isn't working the normal way.Burnett
stackoverflow.com/questions/25532080/… if you still encounter error, I guess the dev env is corrupted.cchantep

1 Answers

0
votes

I have had this problem for 2 days and I had to read through the play and anorm documentation to solve it. You need to note that, in your version of the play framework, anorm is no longer shipped in there. So you have to explicitly declare the anorm dependancy, read:

https://www.playframework.com/documentation/2.5.x/ScalaAnorm

The above link, relates to the version of anorm you should use with your play version. Then add the following in your build.sbt file

libraryDependencies ++= Seq(
jdbc,
"com.typesafe.play" %% "anorm" % "2.5.0"
)

resolvers ++= Seq("scalaz-bintray" at "http://dl.bintray.com/scalaz/releases",
"Typesafe Releases" at "http://repo.typesafe.com/typesafe/releases/")

Delete the previous dependancies, then you need to build your application once again. This time round, restart the play server and then build the application. This worked out so well for me.