Happened to me once. It's very hectic, not easy to find solution. I did one thing, which solved it somehow. I just exported the project zip file, then opened that file again in android studio. This is not a solution, it's somewhat a quick side-hack.