Burnett
Burnett

Reputation: 47

Play 2.3 Scala Anorm import: "not found: object anorm"

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:

Thanks for any help

Upvotes: 1

Views: 1574

Answers (1)

ArnoldKem
ArnoldKem

Reputation: 90

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.

Upvotes: 0

Related Questions