victrcodes/akka-sample-twitter-streaming

build.sbt needs to be updated for library dependencies

Closed this issue · 4 comments

Hello! Thanks for the great template topic!

I ran in to a couple errors on running this Template; which seem to indicate that the build.sbt library dependencies need to be updated to be consistent with each other.
Hoping if you maybe able to take a look.

v1.0 is currently used for the Akka libraries
v2.11.7 is currently used for Scala

I first ran into this bug in Akka on running the code through an Intellij Debugger:
akka/akka#20236

So, I had then pulled the latest version of the Akka http and stream libraries; but then I ran into this bug in the Scala version:
akka/akka#19418

However, after updating all version numbers to presumably be consistent with each other; I'm still getting unresolved build.sbt dependency errors like this:
sbt.ResolveException: unresolved dependency: com.typesafe.akka#akka-stream-experimental_2.12.0-M5;2.12.0-M5: not found
[error] unresolved dependency: com.typesafe.akka#akka-http-experimental_2.12.0-M5;2.12.0-M5: not found
[error] unresolved dependency: com.hunorkovacs#koauth-sync_2.12.0-M5;2.11: not found
[error] unresolved dependency: org.json4s#json4s-native_2.12.0-M5;2.12.0-M5: not found

My latest guess at how to update the build.sbt is below:

libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-stream-experimental" % "2.12.0-M5",
"com.typesafe.akka" %% "akka-http-experimental" % "2.12.0-M5",
"com.hunorkovacs" %% "koauth-sync" % "2.11",
"org.json4s" %% "json4s-native" % "2.12.0-M5"

Your dependencies are all wrong, you put the version of Scala at the end instead of the version of the library. Also, incidentally Scala 2.12.0-M5 is a milestone version which I would advise against using.

Take a look at how current Akka dependencies are defined here. So instead of

"com.typesafe.akka" %% "akka-stream-experimental" % "2.12.0-M5"

you should use

"com.typesafe.akka" %% "akka-stream" % "2.4.8"

I will update the versions when I have time.

That was silly. Thanks for taking the time to explain! I'll try this.

Would you be OK if I posted this question onto StackOverflow, or Akka Users List?
I need to get this working as its my best best for moving forward with a personal project.
Thanks again for sharing this template!

I tried again; and am getting farther in the sbt build process; but even when I clean out my IntelliJ libraries directory and rebuild with the following dependencies, for some reason my sbt build is looking for v2.4.8 for something (which I thought I had deleted all traces of from prior build experiment!)

  1. First I Quit IDEA15; then cleaned out prior libraries in my project directory:

rm -rf .idea/libraries

  1. Then, I did Build/Rebuild project in IDEA15 IDE with the following build.sbt contents:

scalaVersion := "2.11.8"

libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-stream-experimental" % "2.0.4",
"com.typesafe.akka" %% "akka-http-experimental" % "2.0.4",
"com.hunorkovacs" %% "koauth" % "1.1.0",
"org.json4s" %% "json4s-native" % "3.4.0"
)

  1. In my sbt.last.log in ~/Library/Logs/IntellijIdea15; I see:
    *** Unresolved Dependencies
    org.json4s#json4s-native_2.11;2.4.8: not found

Improvement is that all other dependencies were resolved.

Do not know WTF IDEA15 is looking for v2.4.8 of anything at this point either.

You should take the IDE out of equation and try to launch the app with SBT alone.