启动Android程序时出错

时间:2010-04-17 02:40:00

标签: android compiler-errors

[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 out是:

<?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中更改某些内容时都会遇到此问题。这非常令人沮丧,我不知道到底发生了什么。需要训练有素的眼睛!

谢谢!

3 个答案:

答案 0 :(得分:13)

删除项目中的所有main.xml.out个文件。然后, NOT 尝试使用XML文件作为Eclipse中编辑器中的活动选项卡运行项目 - 切换到Java文件。尝试使用XML文件作为活动选项卡运行项目,该选项卡会创建这些.out文件并混淆系统。

可能有更复杂的解决方法,但我不是Eclipse用户,所以我不知道它是什么。

答案 1 :(得分:4)

这让我很伤心。这是一个不需要你切换编辑器的修复:

Eclipse - &gt;窗口 - &gt;偏好 - &gt;运行/调试 - &gt;启动 - &gt;启动操作 - &gt;始终启动先前启动的应用程序

当然删除按建议创建的xml out文件,并确保至少运行一次正确的配置。

答案 2 :(得分:1)

删除 main.out.xml ,如果仍然无法运行,请按照以下步骤操作:
Eclipse - &gt;项目 - &gt;干净...... - &gt;选择你的项目 - &gt;确定