Android SDK中main.out.xml解析错误 [英] Android sdk main.out.xml parsing error

查看:270
本文介绍了Android SDK中main.out.xml解析错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始一个新的Andr​​oid项目,HELLOWORD继续学习Android开发,我得到难倒编译默认的HELLOWORD编译/运行。我想,我错过了在配置和设置的一个步骤,但我很茫然找出我有配置,设置和启动了AVD。

当我preSS运行为,我找不到了Android2.1 simulator.and发现这些错误:

  [2012-07-25 8时59分49秒 -  HELLOWORD]资源\布局\ activity_main.xml:0:错误:资源进入activity_main已定义。
[2012-07-25 8时59分49秒 -  HELLOWORD]资源\布局\ activity_main.out.xml:0:原来这里定义。
[2012-07-25 8时59分49秒 -  HELLOWORD] E:\ Android的软件开发\新建文件夹\ HELLOWORD \水库\布局\ activity_main.out.xml:1:错误:错误解析XML:没有元素发现
[2012-07-25 10点03分十二秒 -  HELLOWORD] / HELLOWORD / GEN已经存在,但不是一个源文件夹。转换为源文件夹或重新命名它。
[2012-07-25十时03分十三秒 -  HELLOWORD] / HELLOWORD / GEN已经存在,但不是一个源文件夹。转换为源文件夹或重新命名它。
[2012-07-25十点○三分15秒 -  HELLOWORD]文件不同步
[2012-07-25十时05分13秒 -  HELLOWORD] / HELLOWORD / GEN已经存在,但不是一个源文件夹。转换为源文件夹或重新命名它。
[2012-07-25十点08分44秒 -  HELLOWORD] activity_main.out.xml不同步。请刷新。
[2012-07-25 10点零八分45秒 -  HELLOWORD] activity_main.out.xml不同步。请刷新。
 

解决方案

这不是你的错。当您尝试从 XML资源编译Android项目,日食认为,作为执行XML文件,并让你从它那里得到一些输出,与 .OUT的XML的相同的名称。 XML 扩展。

要避免这种情况,你必须为右键单击该项目,然后选择运行为 - > Android应用程序的第一次,然后按照下面的步骤,

  

窗口 - > preferences - >运行/调试 - >启动 - >启动操作 - >始终启动previously启动的应用程序

一旦你提供这个在窗口 - > preferences ,从下一次当你preSS 运行CTRL + F11甚至从一个XML文件,您的项目将得到执行。

编辑:您还必须删除的 RES /布局/ * out.xml 的,是Eclipse的创建,你不需要它的文件

I just started a new Android project, helloword" to continue learning Android development and I got stumped compiling the default 'helloword' compile / run. I think that I missed a step in configuration and setup, but I am at a loss to find out where. I have an AVD configured, set and launched.

When I press 'run as', i can not find android2.1 simulator.and find these errors:

[2012-07-25 08:59:49 - helloword] res\layout\activity_main.xml:0: error: Resource entry activity_main is already defined.
[2012-07-25 08:59:49 - helloword] res\layout\activity_main.out.xml:0: Originally defined here.
[2012-07-25 08:59:49 - helloword] E:\android软件开发\新建文件夹\helloword\res\layout\activity_main.out.xml:1: error: Error parsing XML: no element found
[2012-07-25 10:03:12 - helloword] /helloword/gen already exists but is not a source folder. Convert to a source folder or rename it.
[2012-07-25 10:03:13 - helloword] /helloword/gen already exists but is not a source folder. Convert to a source folder or rename it.
[2012-07-25 10:03:15 - helloword] File is Out of sync
[2012-07-25 10:05:13 - helloword] /helloword/gen already exists but is not a source folder. Convert to a source folder or rename it.
[2012-07-25 10:08:44 - helloword] activity_main.out.xml is out of sync. Please refresh.
[2012-07-25 10:08:45 - helloword] activity_main.out.xml is out of sync. Please refresh.

解决方案

It is not your fault. When you try to compile a android project from its xml resource , eclipse considers it as executing xml file and so you get some output from it, in the same name of the xml with .out.xml extension.

To avoid this, you have to right click the project and select run as -> Android Application for the first time and then follow the below steps,

Window -> Preferences -> Run/Debug -> Launching -> Launch Operation -> Always Launch the previously launched application

Once you provide this in the window->preferences, from the next time when you press "run" or "ctrl+f11" from even a xml file, your project will get executed.

EDIT: You must also delete res/layout/*.out.xml, the file that Eclipse created and you do not need it.

这篇关于Android SDK中main.out.xml解析错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆