问题
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.
回答1:
To fix this issue, I imported: import sbt.project
on top of my build.sbt
I am working with IntelliJ IDEA 16 EAP
回答2:
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
回答3:
In my case, after upgrading Intellij forgot that the project was a Scala project.
Delete .idea/
and import the project to fix this.
回答4:
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"
来源:https://stackoverflow.com/questions/34245991/intellij-cannot-resolve-symbol-in-build-sbt