I had this problem for a while and was able to solve it myself.
If in opening your project in Android Studio and something similar to this error message pops up:
In my case it was iml file which was corrupted, so i deleted it, restarted android studio, pasted the same file as it was before, restarted android studio and everything was working fine.