IntelliJ SBT project cannot resolve SBT symbols

intellij cannot resolve symbol library
intellij cannot resolve symbol scala
intellij scala sbt cannot resolve symbol
cannot resolve symbol sparksession intellij
intellij sbt version
build sbt cannot resolve symbol sbt
intellij import sbt project
intellij sbt plugin configuration

I'm banging my head against the wall on this one.

Trying to open a cloned git SBT project at work. It is a combined Java and Scala Play project, with scala 2.11.1, SBT 0.13.6, and Play 2.5.

I use IntelliJ to import project from the cloned repo, with JDK 1.8, and all download and SBT checkboxes checked, and then run either SBT refresh, or reload from SBT shell.

After doing so, all SBT and Play code on both build.sbt and plugins.sbt is painted red, as in "cannot resolve symbol".

Looking at Intellij poroject structure, I have JDK1.8 on the SDK tab, and scala-sdk-2.11 on the Global Libraries tab. SBT and Scala plugins are installed and enabled.

SBT refresh fails on the following Play dependency, which could be the reason for the above symptom, since the SBT build does not complete:

unresolved dependency: com.typesafe.play.plugins#play-statsd_2.11;2.3.0: not found

The dependency does exist: http://dl.bintray.com/typesafe/maven-releases/com/typesafe/play/plugins/play-statsd_2.11/2.3.0/

What am I doing wrong?

Turns out the problem is on the typesafe side, not on my env. All typesafe dependencies on the project are resolved as expected, except for play-statsd.

I manually added this dependency to my ivy cache, and now everything works fine. It was a hard one to isolate, because apparently everybody here already have the dependency on their caches, so seems like their updates work well...

If anyone has the same problem, fetch the dependency from the bintray repository, and manually add it to your ivy cache, e.g.

~/.ivy2/cache/com.typesafe.play.plugins/play-statsd_2.11

The github play-plugins repository has been archived, so I can't open an issue, and don'y know if anyone will take care of it anyway.

Scala+SBT: Cannot resolve symbol – IDEs Support (IntelliJ Platform , I have a multi-project build.sbt file with a multi-layered dependency hierarchy. I found that these errors only occurred for implicit, transitive� In the dialog that opens, select a file that contains your sbt project description build.sbt. Click OK. In the dialog that opens, click Select as Project. IntelliJ IDEA opens and syncs the sbt project in the IDE. If you need to adjust importing options when you open the project, refer to the sbt settings

Unresolved dependency error usually related with Scala version that you are using.

Here is Play 2.3.x documentation. https://www.playframework.com/documentation/2.3.x/Migration22#Update-Scala-version

If you are able to use Play 2.7.x, your issue will be fixed.

IntelliJ "Cannot resolve symbol", but jar is present in libraries – IDEs , ivy2/local location. The jar file does contain the correct symbols. I've tried " Refresh sbt project" and invalidating caches, but am not sure what else� I was getting IDEA errors on imports and other classes of the form "Cannot resolve symbol" although compilation was working fine. I have a multi-project build.sbt file with a multi-layered dependency hierarchy. I found that these errors only occurred for implicit, transitive dependencies.

Could you please add Play StatsD dependency in build.sbt as below and check once.

"com.typesafe.play.plugins" %% "play-statsd" % "2.3.0"

sbt - Help, IntelliJ IDEA opens and syncs the sbt project in the IDE. (Click the icons.actions .refresh.png IntelliJ IDEA cannot reload just a part of your project, it reloads the whole project including subprojects and dependencies. When I open File -> Project Structure -> Libraries and go to the dependency, there are no problems shown, and the path to the jar file correctly points to the jar in my ~/.ivy2/local location. The jar file does contain the correct symbols. I've tried "Refresh sbt project" and invalidating caches, but am not sure what else to try.

You should add maven-releases resolver:

resolvers += "Typesafe Resolver" at "http://repo.typesafe.com/typesafe/maven-releases/"

Troubleshoot common Scala issues - Help, Why am I unable to compile my Scala project?. In most cases your project JDK is not compatible with Scala or sbt version, try to change the� You can always check to see if sbt can run your project on the command line. Running the project. From the Run menu, select Edit configurations; Click the + button and select sbt Task. Name it Run the program. In the Tasks field, type ~run. The ~ causes sbt to rebuild and rerun the project when you save changes to a file in the project. Click

Issue while creating sbt project in IntelliJ - Question, Project does get created with build.sbt as: name := “scalalearning” version := “0.1 ” scalaVersion := “2.12.4” But IntelliJ says 'Cannot resolve symbol' for all these� So if you "open" an sbt-based project it goes to the import dialog, you select the options and it starts processing the sbt file. Then the import progress window just disappears. You can go and open the project and it hasn't processed sbt correctly - so it is just listing the sbt file and none of the source

IntelliJ cannot resolve symbol in build.sbt, IntelliJ IDEA 15 is reporting an unresolved symbol for my project definition in my build.sbt file lazy val root = (project in file(".")).enablePlugins(PlayScala). To whom it may concern: Creating a Scala SBT project and then simply creating Java classes seems to work just fine. If you rename the package `src/main/scala` to `src/main/java` you need to run `sbt` in the terminal in the project folder or `reload` from the sbt shell window. But I just created a Main class and a test via JUnit.

IntelliJ Idea 14: cannot resolve symbol spark - scala - html, a new project with Spark, my SBT does not import the external jars of org. apache.spark. Therefore IntelliJ Idea gives the error that it "cannot resolve symbol ". Hi! Sorry I lost track of this. Counter.scala is in the root directory of the components/counter project, which is not imported as source directory in the IDEA model (you can see this in the Project Structure dialog under "Modules").

Comments
  • Can you please share dependency for Play StatsD. Which version of Play StatsD has been used in build.sbt?
  • There is no such dependency in build.sbt
  • It's possible the resolver isn't set up correctly, you can check by entering resolvers in the sbt shell, and looking at what repositories are being tried in the sbt log when updating
  • Hi..It's problem with play-statsd jar not Play jar.
  • Thanks Bahadir, but I'm bound to Play 2.5, and migration documentation does not offer any remedy to my issue
  • Tried adding the dependency, and tried excluding it. None do the trick.
  • If you don't have play statsd depedency in built.sbt file then from where it is trying to download? Can you please share all your dependencies.Not scree shot please.
  • Please share your full build.sbt content.
  • It's most likely some internal dependency in Play