Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unresolved dependencies error in akka

Tags:

scala

akka

sbt

hi i am new on akka and m trying to develop sample akka application but when i execute run command on shell it gives me Unresolved Dependencies warnings and then shows error

here is my Main.scala file

import akka.actor.Actor
import akka.actor.ActorSystem
import akka.actor.Props
 
class HelloActor extends Actor {
  def receive = {
    case "hello" => println("hello back at you")
    case _       => println("huh?")
  }
}
 
object Main extends App {
  val system = ActorSystem("HelloSystem")
  // default Actor constructor
  val helloActor = system.actorOf(Props[HelloActor], name = "helloactor")
  helloActor ! "hello"
  helloActor ! "buenos dias"
}

build.sbt

name := "tryakka"

version := "1.0"

scalaVersion := "2.11.1"

resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"

libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.3.4"

following are the warnings and erors

[warn]  module not found: com.typesafe.akka#akka-actor_2.11.1;2.3.4
[warn] ==== local: tried
[warn]   /home/ahsen/.ivy2/local/com.typesafe.akka/akka-actor_2.11.1/2.3.4/ivys/ivy.xml
[warn] ==== Typesafe Repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/com/typesafe/akka/akka-actor_2.11.1/2.3.4/akka-actor_2.11.1-2.3.4.pom
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/com/typesafe/akka/akka-actor_2.11.1/2.3.4/akka-actor_2.11.1-2.3.4.pom
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.typesafe.akka#akka-actor_2.11.1;2.3.4: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/home/ahsen/SbtPrctc/tryakka/}default-240ba8/*:update: sbt.ResolveException: unresolved dependency: com.typesafe.akka#akka-actor_2.11.1;2.3.4: not found

thanks in advance

like image 594
M.Ahsen Taqi Avatar asked Jul 24 '14 11:07

M.Ahsen Taqi


1 Answers

Currently the dependency that you need is:

libraryDependencies += "com.typesafe.akka" % "akka-actor_2.11" % "2.3.4"

The difference that it's built for Scala version 2.11, not 2.11.1. Your dependency uses %% which substitutes Scala version set in the build, hence the error - your URL includes minor version and such resource does not exist.

UPDATE:

I created a small project that includes your code which compiles and runs. Check it out here: https://github.com/izmailoff/SmallAkkaProjectExample

like image 76
yǝsʞǝla Avatar answered Oct 14 '22 00:10

yǝsʞǝla