9

I updated Intellij Idea to 2018.2.6 enter image description here

Now I can not start my Play-Project with a Play-Configuration - it gives me this:

[error] Not a valid project ID: myProject
[error] project myProject
[error] ^

I tried all of these proposals:

https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000530510-SBT-Shell-Error-Not-a-valid-key-idea-shell?flash_digest=650678ba2e9ae36479f2c3e0ab460379a393d2ce

A plain SBT configuration works.

4 Answers 4

17

I could solve the problem:

  • Close Project in Intellij.
  • Delete .idea folder of the Project.
  • Open the Project again.
6
  • 1
    it is annoying that IntelliJ cannot deal with this normally and you have to do this. My experience is that running from command line is the most reliable! (like you go to the project folder and say idea . assuming that idea is in path.)
    – Mahdi
    Dec 16, 2018 at 14:55
  • 2
    deleting the folder did not work for me in idea 2019.3
    – nemoo
    Jan 24, 2020 at 13:31
  • @nemoo just add your solution as an answer - may help someone else
    – pme
    Jan 24, 2020 at 15:22
  • 1
    Unfortunately I do not have a solution. I wanted to describe what I found out.
    – nemoo
    Jan 27, 2020 at 8:59
  • 2
    Note that you'll lose scratches, config, and the like, so backup any configuration that you'll lose before giving this a try. (Also, it didn't work for me.)
    – micseydel
    Mar 18, 2020 at 16:20
6

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".

2
  • 1
    thanks - this worked also for another question of mine;) > stackoverflow.com/a/60046077/2750966
    – pme
    Feb 3, 2020 at 19:41
  • 1
    On IntelliJ 2021.3, the menu item is named: "Reload sbt Project" instead, but the steps are the same.
    – muya_
    Dec 15, 2021 at 9:04
1

Using IntelliJ Idea Ultimate 2020.2 none of the above worked for me.

I had to

  • Delete the .idea folder
  • Restart IntelliJ
  • File -> Project Structure
  • Create a new play module at the same location
1
  • Run into the same problem: for me it was a matter of folder name: the folder name had to match the module name. Also having play module and java gradle modules mixed in the same project messed things up for sbt. In the end I run play module as a project in a separate window from the other project
    – ilmirons
    Dec 21, 2020 at 9:58
0

I had a variation of this, which is probably not that common, but I mention it just in case someone encounters the same thing.

We have a Play2 project wrapped in a larger Maven based project. Surprisingly IntelliJ actually imports this quite well, and it basically works running it as a Play2 application within that larger project.

However some time ago I reimported the entire project and I used the Maven import option to "Keep project files in:", and put them outside the project directory structure. So now all the .iml files are in another directory. But when this was the case the sbt runner would try to load the project from that directory, and of course it couldn't find my project file any longer with the same error as given in the original question.

The solution in this case is that the Intellij .iml file must be in the same directory as your Play2 application.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.