Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Content is not allowed in prolog

Tags:

eclipse

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 anything. I have no idea what has gone wrong, anybody seen this before?

like image 635
Ranger Avatar asked Mar 26 '11 20:03

Ranger


People also ask

How do I fix content is not allowed in prolog eclipse?

don't know if this is a "solution", but I had the same error. I was able to access the Eclipse menu, selected Project -> Clean and selected all the projects. Closed the eclipse (first time hanged, second time successfully) and the opened again successfully.


1 Answers

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.

like image 133
Aquanauta Avatar answered Sep 22 '22 13:09

Aquanauta