42

After a System Crash the sbt-console of Intellij 2019.1 can not start:

The following Exception is thrown:

<set>:1: error: not found: value ideaPort
ideaPort in Global := 49516

Strangely another project just works fine.

I removed .idea with no success.

Update: Different ideaPort, same Problem /solution

<set>:1: error: not found: value ideaPort
ideaPort in Global := 53318
pme
  • 14,156
  • 3
  • 52
  • 95

3 Answers3

83

I fixed by deleting the <project base>/project/target directory, as suggested here: https://youtrack.jetbrains.com/issue/SCL-15160#focus=streamItem-27-3373132.0-0

On Terminal: rm -r project/target

pme
  • 14,156
  • 3
  • 52
  • 95
Andreas Presthammer
  • 1,886
  • 2
  • 19
  • 31
  • 2
    This worked for me without needing to change the bytecode indices setting – Ali May 20 '19 at 06:05
  • I have followed all the steps above and it still hasn't helped. I wish I understood how this went from working to not working. – gknauth Jun 03 '19 at 17:51
  • 8
    Ensure that you are actually deleting '/project/target' , and not the '/target' dir on the root of your project. – Andreas Presthammer Jun 04 '19 at 06:37
  • 1
    I figured out how to get `sbt-idea-shell` to work again (for me). If you are using `sbt-coursier`, you have to use the proper setting re: installed as the only plugin vs. installed alongside other plugins. It had been installed as "alongside other plugins" and after I changed the `sbt-coursier` plugin setup to "as the only plugin," then `sbt-idea-shell` started working again. See the `sbt-coursier` docs for detailed info on the different configurations. – gknauth Jun 04 '19 at 18:52
  • 1
    Deleting `/project/target` didn't help me, but invalidating caches and restart did. – Dmytro Mitin Jul 22 '19 at 08:24
  • 1
    Today, deleting /project/target did help. – gknauth Sep 16 '19 at 15:13
17

Disable Preferences | Build, Execution, Deployment | Compiler | Scala Compiler | Bytecode Indices as a workaround.

Follow this bug for the updates.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
6

There is now even a simpler way that worked for me:

I got it from here https://stackoverflow.com/a/60042492/2750966

In my case, the reimporting of sbt project fixed the issue. This can be done by clicking on the "sbt" tab on the right pane, right-click on the project and selecting "Reimport sbt Project".

Or just hit the refresh button:

enter image description here

pme
  • 14,156
  • 3
  • 52
  • 95