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

后端 未结 12 930
温柔的废话
温柔的废话 2020-12-24 11:37

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

12条回答
  •  我在风中等你
    2020-12-24 12:06

    To fix this in one of my layout XML files, I did the following from within ADT:

    • right-click on the file in the Package Explorer
    • Pick Open With -> Text Editor

    Now the offending line gets highlighted with a big red X.

    • I then deleted the line endings (combining the two lines) and then hit "return" to add it back in. In some cases I found that didn't quite work so I copied a similar line that didn't have the issue, and pasted it over top of the offending line (highlight the bad line, then paste). Sometimes it seemed that the real issue was with the line before or after it.

    Then after saving it would show up the next bad line, so lather-rinse-repeat until it's all done.

    • When all done, use right-click, Open With -> Android Common XML Editor to get back to the visual design view.

    (ADT v21.0.1, on Mac OSX Lion)

提交回复
热议问题