0

I want to learn and compile the project,but the build.sbt is highlighted in red when import with Intellij IDEA 2020.02. cannot resolve symbol enter image description here

But compiling on the command line can succeed and invalidate cahce does not work. sbt compile success And my project structure is project structure

Toni.W
  • 113
  • 1
  • 2
  • 12
  • Have you added the Scala framework to your project, if you imported it from somewhere else? – user Oct 19 '20 at 13:17
  • 1
    Have you imported build as sbt build or e.g. bsp build? When you open quick goto command is there more than one build.sbt? – Mateusz Kubuszok Oct 19 '20 at 13:35
  • 1
    In my experience this just happens, with no reason. Often reloading the sbt project helps. – Suma Oct 19 '20 at 14:26
  • try invalidate cache and restart this should work as @Suma said it happens for no reason. – Raman Mishra Oct 19 '20 at 21:17
  • @Suma It does not work, I have tried. – Toni.W Oct 20 '20 at 01:46
  • @user No,I did not add the scala framework for my project and do not know the framework in my project. – Toni.W Oct 20 '20 at 01:49
  • @MateuszKubuszok I don't quite understand what you mean but there is only one build.sbt in my project. – Toni.W Oct 20 '20 at 01:52
  • Verify if you see a Scala SDK in your project settings. (There is no such think as Scala framework or Scala facet any more, you can find about them in older guides, but nothing like this exists in recent version, only Scala SDK). Can you show what you see in your Project structure after the SBT import? – Suma Oct 20 '20 at 07:30
  • @Toni.W sbt doesn't support symlinks so if you store your workspace on symlinked folder, then what sbt outputs as your project files might have different paths than your local files. Then you can see two `build.sbt` in IntelliJ where one is displayed is whole red, and the other one is parsed correctly. – Mateusz Kubuszok Oct 20 '20 at 11:23
  • @MateuszKubuszok oh,there are two build.sbt files of, and one is in root folder but the other is in project folder. – Toni.W Oct 23 '20 at 06:35
  • Does it look like [that issue](https://github.com/sbt/sbt/issues/4552)? – Mateusz Kubuszok Oct 23 '20 at 07:01

0 Answers0