Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strange xml error: Incorrect line ending

I haven't used Eclipse since 1 week ago. Today I started it and I noticed that it loaded slowly. When it was started it prompted this:

http://tinypic.com?ref=2zpk1g2&quot; target="_blank"><img src="http://i48.tinypic.com/2zpk1g2.png&quot; border="0" alt="Image and video hosting by TinyPic"></a>">

I thougth that maybe Eclipse has updated something of Android so I updated to the newest ADT. Now I have the same error but I have an extra big error that I don't know if it's because the previous error. I have tried the new feature of look how an xml layer looks in many devices. I have tried with 2 layers and now the program doesn't compiles because it says:

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

The error for one xml is in this line:

     android:layout_height="wrap_content">     

and the other one is in:

    android:orientation="horizontal"> 

wtf has happened? I didn't change anything nor saved it and 1 week ago all was fine.

like image 832
Learning from masters Avatar asked Nov 15 '12 15:11

Learning from masters


2 Answers

I just got the same annoying problem. What I did was copying the entire code into notepad. Then from notepad, paste it back into the xml field. I know, it sounds stupid, but it worked and I have no idea why -__-"

like image 127
aishareefa Avatar answered Sep 19 '22 00:09

aishareefa


Simple solution:

Press: Ctrl + Shift + F and then save. It's a matter of formatting. This will format it.

like image 23
AndroidPenguin Avatar answered Sep 23 '22 00:09

AndroidPenguin