0

I am writing a toy Akka example to get some understanding of the concepts. I am having trouble importing the akka model into my project in intelij. I am making the below import statement

import akka.actor.Actor

The error messgae reads

 cannot resolve the symbol Akka

Is there an additional step to working with akka that I have missed ? Why does the compiler not recognise the import ?

Steve
  • 4,388
  • 3
  • 17
  • 25
  • 1
    What version you have added in your dependencies? – Amit Prasad Nov 22 '18 at 12:07
  • dependencies look like this ----- libraryDependencies in ThisBuild ++= Seq( "com.typesafe.akka" %% "akka-actor" % "2.5.18", "org.scalactic" %% "scalactic" % "3.0.4", "org.scalatest" %% "scalatest" % "3.0.4" % Test, "org.scalamock" %% "scalamock" % "4.1.0" % Test, "org.scalacheck" %% "scalacheck" % "1.13.4" % Test ) – Steve Nov 22 '18 at 12:21

1 Answers1

3

You have to add Akka dependency to your build.sbt

https://mvnrepository.com/artifact/com.typesafe.akka/akka-actor_2.11/2.5.18

Then you should reimport the dependency, using sbt tool in your ide as mentioned here: https://stackoverflow.com/a/20466144/2201566

Mahmoud Hanafy
  • 1,861
  • 3
  • 24
  • 33
  • And then maybe re-import the sbt into IntelliJ if it is not set up to do it automatically (it should prompt for it at least) – Thilo Nov 22 '18 at 12:10
  • How do you mean by reimport now ? I have added the line "com.typesafe.akka" %% "akka-actor" % "2.3.8" to the build in libraryDependencies but that still did not resolve it , so re-importing the sbt is probably required ? – Steve Nov 22 '18 at 12:13
  • Depending on your settings, you might need to refresh the project for intellij.s integrated compiler to notice the change in dependencies. – Pietrotull Nov 23 '18 at 14:06