[Debug]Android 编辑xml中Incorrect line ending错误解决方法

原创文章,欢迎转载。转载请注明:转载自 祥的博客 原文链接:http://blog.csdn.net/humanking7/article/details/43418599

问题描述:

今天移植代码的时候发现layout的一个文件有错误,错误详情如下:

Description

Resource

Location

TypeDescription

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

main.xml

/TestSyncListView/res/layoutline 21

Android Lint Problem

提示如下图所示:

解决办法:

方法一:(国外一网站帖子)

Using Eclipse on Windows

Open layout file

Ctrl+Shift+F (Command+Shift+F in MacOSX)

Save the layout file and close it.

Delete any .out files the builder might have created.

Clean project.

方法二:

步骤如下(亲测有效,前提是代码没有问题)

点击工具栏project

点击下拉菜单的clean

分析:

个人认为是文字编码的问题,GBK和UTF-8的问题。我一般都是用UTF-8编辑的,因为这样兼容性更好一点。