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

来源:互联网 发布:域名可以一年一年续费 编辑:程序博客网 时间:2024/06/06 04:19

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


问题描述:


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

DescriptionResource LocationTypeDescriptionIncorrect line ending: found carriage return (\r) without corresponding newline (\n) main.xml  /TestSyncListView/res/layoutline 21 Android Lint Problem


    提示如下图所示:


解决办法:


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

        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.    

方法二:


        步骤如下(亲测有效,前提是代码没有问题)
    1. 点击工具栏project 
    2. 点击下拉菜单的clean 

分析:


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