I received error in my xml file. \"Incorrect line ending: found carriage return (\\r) without corresponding newline (\\n).
It's easier than other answers:
Ctrl + 1 -> Fix lines
;)
To fix this in one of my layout XML files, I did the following from within ADT:
Now the offending line gets highlighted with a big red X.
Then after saving it would show up the next bad line, so lather-rinse-repeat until it's all done.
(ADT v21.0.1, on Mac OSX Lion)
First refresh the project then clean (Ctrl+shift+F).
This solves the problem for me.
Cut your whole code, save the xml, paste the code again in the file and save. It also solves at times. Though not a standard way, but works.
Yesterday, I got this very same error message.
My fix is by simply removing every newline after
/>
So, if you have
<Button
/>
<Button
/>
change it into
<Button
/>
<Button
/>
Might not be the best solution.
If you happen to get this annoying error from time to time when you open an android activity xml
file just press ctrl+shift+f
to reformat your text and you’re good to go!