2010-04-17 95 views
2
 
[2010-04-16 23:31:34 - MobileDataKeeper] Error in an XML file: aborting build. 
[2010-04-16 23:31:57 - MobileDataKeeper] Error in an XML file: aborting build. 
[2010-04-16 23:32:28 - MobileDataKeeper] Error in an XML file: aborting build. 
[2010-04-16 23:34:56 - MobileDataKeeper] Error in an XML file: aborting build. 
[2010-04-16 23:35:14 - MobileDataKeeper] res/layout/main.out.xml:0: error: Resource entry main is already defined. 
[2010-04-16 23:35:14 - MobileDataKeeper] res/layout/main.out.out.xml:0: Originally defined here. 
[2010-04-16 23:35:14 - MobileDataKeeper] res/layout/main.xml:0: error: Resource entry main is already defined. 
[2010-04-16 23:35:14 - MobileDataKeeper] res/layout/main.out.out.xml:0: Originally defined here. 
[2010-04-16 23:35:14 - MobileDataKeeper] /media/Mis Documentos/Dropbox/Eclipse/MobileDataKeeper/res/layout/main.out.out.xml:1: error: Error parsing XML: no element found 
[2010-04-16 23:35:14 - MobileDataKeeper] /media/Mis Documentos/Dropbox/Eclipse/MobileDataKeeper/res/layout/main.out.xml:1: error: Error parsing XML: no element found 
[2010-04-16 23:35:49 - MobileDataKeeper] Error in an XML file: aborting build. 

Main.xml.out。*爲空。該MobileDataKeeper.java是默認和Mainx.xml的是:啓動Android程序時出錯

<?xml version="1.0" encoding="utf-8"?> 

<RelativeLayout 
    android:id="@+id/RelativeLayout01" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    xmlns:android="http://schemas.android.com/apk/res/android" /> 

每次我改變的東西在main.xml中搞定這個問題。這很令人沮喪,我不知道發生了什麼。需要訓練有素的眼睛!

謝謝!

+0

可能的重複http://stackoverflow.com/questions/1674101/android-project-wont-build-when-editing-a-resource-file – SteveCav 2011-11-08 00:50:47

回答

13

刪除項目中的所有main.xml.out文件。然後,執行NOT嘗試使用XML文件作爲Eclipse中編輯器中的活動選項卡運行項目 - 切換到Java文件。這是嘗試使用XML文件作爲活動選項卡來運行項目,該選項卡會創建這些文件並混淆系統。

可能有更復雜的解決方法,但我不是Eclipse用戶,所以我不知道它是什麼。

+0

是的,我想明白了我自己。謝謝! – 2010-04-17 20:36:27

+2

最有用的答案。 Eclipse中有什麼可怕的錯誤 - 我以爲我會愚蠢或盲目尋找不存在的不良xml! – NickT 2010-10-28 11:40:07

1

刪除main.out.xml,如果仍然不能運行,然後按照此:
的Eclipse - >項目 - >清除... - >選擇你的項目 - >確定

4

這讓我很難過。繼承人不需要你修復切換編輯:

的Eclipse - >窗口 - >首選項 - >運行/調試 - >啓動 - >啓動運行 - >始終啓動之前啓動的應用程序

當然刪除以建議的方式創建的xml輸出文件,並確保至少運行正確的配置至少一次。