【问题标题】:Error starting an Android program启动 Android 程序时出错
【发布时间】:2010-04-17 02:39:59
【问题描述】:
[2010-04-16 23:31:34 - MobileDataKeeper] XML 文件中的错误:正在中止构建。 [2010-04-16 23:31:57 - MobileDataKeeper] XML 文件中的错误:正在中止构建。 [2010-04-16 23:32:28 - MobileDataKeeper] XML 文件中的错误:正在中止构建。 [2010-04-16 23:34:56 - MobileDataKeeper] XML 文件中的错误:正在中止构建。 [2010-04-16 23:35:14 - MobileDataKeeper] res/layout/main.out.xml:0:错误:资源条目 main 已定义。 [2010-04-16 23:35:14 - MobileDataKeeper] res/layout/main.out.out.xml:0:最初在这里定义。 [2010-04-16 23:35:14 - MobileDataKeeper] res/layout/main.xml:0: 错误:资源条目 main 已定义。 [2010-04-16 23:35:14 - MobileDataKeeper] res/layout/main.out.out.xml:0:最初在这里定义。 [2010-04-16 23:35:14 - MobileDataKeeper] /media/Mis Documentos/Dropbox/Eclipse/MobileDataKeeper/res/layout/main.out.out.xml:1:错误:解析 XML 时出错:找不到元素 [2010-04-16 23:35:14 - MobileDataKeeper] /media/Mis Documentos/Dropbox/Eclipse/MobileDataKeeper/res/layout/main.out.xml:1:错误:解析 XML 时出错:找不到元素 [2010-04-16 23:35:49 - MobileDataKeeper] XML 文件中的错误:正在中止构建。

Main.xml.out.* 为空。 MobileDataKeeper.java 是默认的,而 Mainx.xml 输出是:

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

谢谢!

【问题讨论】:

标签: android compiler-errors


【解决方案1】:

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

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

【讨论】:

  • 是的,这是我自己想出来的。谢谢!
  • 最有用的答案。 Eclipse 中多么可怕的错误 - 我以为我在寻找不存在的坏 xml 时会变得愚蠢或盲目!
【解决方案2】:

这可要了我的命。这是一个不需要您切换编辑器的修复:

Eclipse -> 窗口 -> 首选项 -> 运行/调试 -> 启动 -> 启动操作 -> 始终启动之前启动的应用程序

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

【讨论】:

    【解决方案3】:

    删除 main.out.xml,如果仍然无法运行,请按照以下步骤操作:
    Eclipse -> Project -> Clean... -> 选择您的项目 -> 好的

    【讨论】:

      猜你喜欢
      • 2011-10-17
      • 2013-09-15
      • 1970-01-01
      • 1970-01-01
      • 2015-05-26
      • 2017-11-03
      • 1970-01-01
      相关资源
      最近更新 更多