incorrect line ending: found carriage return (\r) without corresponding newline (\n)

I got this error message in one of my Android layout files (some API library that I downloaded from the web) thought there was no syntax error in that line number that displayed this error. So this was something to do with a carriage return and newline character mismatch.

Solution :

Way's to resolve this issue for ADT Eclipse,

1. Cut the content of the file using Command + X (macOS)/ Ctrl + X (Windows).

2. And Just Paste the content back to the file : Command + V (Mac OS X)/ Ctrl + V (Windows).

Update :

It seems like when you Format the code using Command + Shift + F (Mac OS X)/ Ctrl + Shift + F (Windows) also does the trick.

Topics Coverage:

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.

Follow Us: GitHub | Facebook | Twitter | Instagram