Intellij: Not a valid project ID:

Viewed 8034
4 Answers

I could solve the problem:

  • Close Project in Intellij.
  • Delete .idea folder of the Project.
  • Open the Project again.

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

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

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.

Related