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:
Cannot load settings from file (C:\Users\User\AndroidStudioProjects\ProjectName\.idea\workspace.xml): Error on line 1: Content is not allowed in prolog. Please correct the file content.
It probably means your project workspace settings file is corrupted by whatever reason and Android Studio could not read it. Mine is probably because of BSOD, because Windows.
To solve the error, just delete the workspace.xml as specified in the error message. It is ok to delete it since you probably already lost all your custom workspace settings when the file got corrupted and you will never be able to save new workspace settings unless you fix the corrupted file. After deleting it, the next time you open your project in Android Studio, it will try to look for the workspace file, and if it can't find it, it will just create a new valid one.
I hope this helps! :)
Step 1 :Exit Android Studio.
Step 2 :Delete workspace.xml
file found in the \ProjectName\.idea\
directory.
Step 3 :Run Android Studio again.
On a Mac, I found File > Invalidate Caches/Restart did the trick.
on a windows 8.1, I found File > Invalidate Caches/Restart did the trick
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With