I\'m having trouble opening my main in my eclipse project. It keeps coming up with:
\"content is not allowed in prolog\"
I haven\'t altered my code or anythi
i delete the c:/users/your_computer/appdata/.gradle/cache and it went go to normal
Restarting Eclipse and Cleaning the problem dint help.
I opened the .xml file in a XML editor and did a Validate
on that error alone. this solved my problem. Hope this helps for people who still got the problem
Yeah, I had the same, and the first line in strings.xml:
<?xml version="1.0" encoding="utf-8"?>
was marked with this error. Though I also didn't alter any code, yesterday, when I closed Eclipse, everything was fine, no errors (though some warnings were present, but that doesn't matter, I think)
All I did now is Selecting this line, Ctrl+X (Cut) it, Ctrl+S to save, Ctrl+V (Paste) it back and Ctrl+S again, and the error is gone. Not sure if it will work for everybody, but it did for me 8)
I had the same error and figured it out.
When I tried to create a new string resource, I tried to paste the new resource value on the "Android Resources" screen. To my surprise, the paste operation (using CTRL + V) does not work on that screen, and I tried it several times.
After that I started getting the error. When I switched from the "Android Resources" screen to the raw XML screen of the Strings.xml file, I noticed that all the text that I tried to paste was at the beginning of the file, like this:
Image content description. Image content description.<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">My App</string>
</resources>
And that was causing the error for me.
Its most likely an encoding problem: (edit in notepad++ and select) encoding utf-8 -BOM
I fix it with a non - xml file by clearing the file in the text editor, save the empty file and paste it back. (CTRL+A, CTRL+X, CTRL+S, CTRL+V, CTRL+S)