CodeShaman
CodeShaman

Reputation: 2189

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)

It's reporting an error with project and in.

Cannot resolve symbol project.
Cannot resolve symbol in.

Everything else resolves perfectly and the project is otherwise all set up, sbt builds fine, activator runs fine.

Upvotes: 24

Views: 30150

Answers (5)

dr jerry
dr jerry

Reputation: 10026

I had an issue with http references in my ~/sbt/repositories file. When I changed this to https all was well.

typesafe-releases: https://repo.typesafe.com/typesafe/releases
typesafe-ivy-releasez: https://repo.typesafe.com/typesafe/ivy-releases, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]

Upvotes: 0

Ruurtjan Pul
Ruurtjan Pul

Reputation: 1377

In my case, after upgrading Intellij forgot that the project was a Scala project.

Delete .idea/ and import the project to fix this.

Upvotes: 21

Fabszn
Fabszn

Reputation: 144

To fix this issue, I imported: import sbt.project on top of my build.sbt

I am working with IntelliJ IDEA 16 EAP

Upvotes: 9

Matt Klein
Matt Klein

Reputation: 8424

This happened to me when when the "external library" referenced was a different version than the one stated in the build.sbt file. Specifically:

External Libraries -> SBT: org.scala-lang:scala-library:2.12.1

build.sbt -> scalaVersion := "2.12.2"

Upvotes: 4

CodeShaman
CodeShaman

Reputation: 2189

I looked on jetbrains' error tracker and found this is a known bug.

"Cannot resolve symbol project" in build.sbt

https://youtrack.jetbrains.com/issue/SCL-9512

Upvotes: 5

Related Questions