Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

android

I received error in my xml file. "Incorrect line ending: found carriage return (\r) without corresponding newline (\n).

<Button
     android:id="@+id/btn_login"
     android:layout_width="100dip"
     android:layout_height="wrap_content"
     android:layout_alignParentBottom="true"
     android:layout_alignRight="@+id/et_un"
     android:layout_marginBottom="15dp"
     android:layout_marginRight="22dp"
     android:text="Login"
     android:textColor="#AA0000"
     android:textSize="10pt" />

How to solve it. can anyone help

like image 587
user1931166 Avatar asked Dec 27 '12 04:12

user1931166


4 Answers

Using Eclipse on Windows?

  1. Open layout file
  2. Ctrl+Shift+F (Command+Shift+F in MacOSX)
  3. Save the layout file and close it.
  4. Delete any .out files the builder might have created.
  5. Clean project.
like image 50
323go Avatar answered Nov 18 '22 16:11

323go


It looks like stupid thing, But It worked for me

  1. select all (ctrl+a)
  2. cut (ctrl+x )
  3. Paste it again (ctrl+v)
  4. Save it (ctrl+s)

It really worked for me.

like image 25
Mohammed Yasin Avatar answered Nov 18 '22 16:11

Mohammed Yasin


It's easier than other answers:

Ctrl + 1 -> Fix lines

;)

like image 12
Jose Antonio Benitez Montero Avatar answered Nov 18 '22 17:11

Jose Antonio Benitez Montero


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.

like image 7
ariefbayu Avatar answered Nov 18 '22 17:11

ariefbayu