首页 > 叽歪生活 > eclipse编译android错误:res\layout\main.out.xml:0: error

eclipse编译android错误:res\layout\main.out.xml:0: error

2010年12月22日 发表评论 阅读评论

今天运行一个android小程序,又莫名其妙的出现一个错误,错误信息如下:

[2010-12-22 20:37:17 - Study] Error in an XML file: aborting build.
[2010-12-22 20:37:18 - Study] res\layout\main.xml:0: error: Resource entry main is already defined.
[2010-12-22 20:37:18 - Study] res\layout\main.out.xml:0: Originally defined here.
[2010-12-22 20:37:18 - Study] G:\Android\Study\res\layout\main.out.xml:1: error: Error parsing XML: no element found
[2010-12-22 20:37:18 - Study] res\layout\main.xml:0: error: Resource entry main is already defined.
[2010-12-22 20:37:18 - Study] res\layout\main.out.xml:0: Originally defined here.
[2010-12-22 20:37:18 - Study] G:\Android\Study\res\layout\main.out.xml:1: error: Error parsing XML: no element found
[2010-12-22 20:39:06 - Study] Error in an XML file: aborting build.
[2010-12-22 20:39:26 - Study] res\layout\main.xml:0: error: Resource entry main is already defined.
[2010-12-22 20:39:26 - Study] res\layout\main.out.xml:0: Originally defined here.
[2010-12-22 20:39:26 - Study] G:\Android\Study\res\layout\main.out.xml:1: error: Error parsing XML: no element found

网上搜了下,遇到这样问题的还真不少,找了一篇老外的帖子,其中一个解决办法我试了下,解决问题。方法如下:

防止out.xml文件被创建的方法:

  1. edit an XML file, a perfectly natural thing to do….
  2. save and close the XML file
  3. Open any .java file in src/
  4. Double click in the file to ensure it has focus and the cursor is in there.
  5. Run… should be OK now

如果out.xml文件已经出来,即错误已经有了(我遇到的就是这问题),解决的办法:

  1. edit an XML file, a perfectly natural thing to do….
  2. Run… crash due to dreaded out.xml file
  3. Delete the /res/_.out.xml file
  4. Close all files in the IDE view
  5. Project…Clean…
  6. Open any .java file in src/
  7. Double click in the file so it has focus and the cursor is in there.
  8. Run… should be OK now

总结了下,其实只要到eclipse中project->clean(选择你出错的项目),然后重新运行你的项目即可。

转载请标明出处:萝卜根

原文地址请标明:原文地址

  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.
*

:yund: :yun: :yes: :xiaxia: :xiaom: :xiaohan: :wuyu: :wuxiao: :woshou: :woquan: :wink: :tiaodou: :tiaod: :sikao: :pa: :oops: :ok: :no: :mad: :lihai: :leihua: :lei: :ku: :konghe: :kbu: :jiwai: :jiong: :jiay: :huo: :huaixiao: :hanxiao: :han: :haha: :guolai: :guan: :guai: :ganga: :eek: :dou: :diao: :deng: :buli: :bizui: :bishi: :biggrin: :arrow: