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.

Try Out Code2care Dev Tools:


Android Java Linux Microsoft Google Python macOS Notepad++ Microsoft Teams CSS PHP SharePoint Html Linux C Programs Bootstrap jQuery Sublime Android Studio Facebook Eclipse WhatsApp News MySQL Json HowTos JavaScript FTP S3


Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Tutorials, Trouble-Shooting steps, Video Tutorials, Code Snippets, How Tos, Blogs, Articles, etc.
🎉 We are celebrating the 10th years of Code2care! Thank you for all your support! We hope we made a difference.
We strong support Gender Equality & Diversity.

We stand in solidarity with Ukraine - Make a donation to UNHCR -