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:
Just delete .idea folder from project directory an re run android studio. it worked for me.
I am using Android Studio 4.0 I solved this by:
Deleting .idea
folder in the Project
Restart Android Studio
Done :)
A gradle sync did the trick for me.
Just press the button from the toolbar named "sync project with gradle files". The icon is an elephant with a little blue arrow.
If it still does not work, try deleting the .idea folder first, before syncing the gradle files again.
Had Today the same Problem, but i found a "workspace.xml" with something like "jpt_tmp" at his end, in the same directory. After swaping the "tmp" once with the original, i got everything back to work.
I tried many options but finally for windows 10, File > Invalidate Caches/Restart worked for me.
Step 1 :Exit Android Studio.
Step 2 :Delete workspace.xml
file found in the \ProjectName\.idea\
directory.
Step 3 :Run Android Studio again.