I had this error and noticed my main class was not under the default directory. I tried to move the class under default and it disappeared. I then ran restore from local history and it showed up under src again, but not under default.
I created a new project and moved all the classes under its default directory. It is working there.