android sdk main.out.xml解析错误?
我刚刚启动了一个新的 Android 项目“WeekendStudy”来继续学习 Android 开发,但我在编译默认的“hello Weekendstudy”编译/运行时遇到了困难。我认为我错过了配置和设置的一个步骤,但我不知道在哪里。我已配置、设置并启动了 AVD。
当我按“运行”时,SDK 正在构建文件 main.out.xml,然后失败,如下所示:
[2010-03-06 09:46:47 - WeekendStudy]Error in an XML file: aborting build.
[2010-03-06 09:46:48 - WeekendStudy]res/layout/main.xml:0: error: Resource entry main is already defined.
[2010-03-06 09:46:48 - WeekendStudy]res/layout/main.out.xml:0: Originally defined here.
[2010-03-06 09:46:48 - WeekendStudy]/Users/mobibob/Projects/workspace-weekend/WeekendStudy/res/layout/main.out.xml:1: error: Error parsing XML: no element found
[2010-03-06 09:48:16 - WeekendStudy]Error in an XML file: aborting build.
[2010-03-06 09:48:16 - WeekendStudy]res/layout/main.xml:0: error: Resource entry main is already defined.
[2010-03-06 09:48:16 - WeekendStudy]res/layout/main.out.xml:0: Originally defined here.
[2010-03-06 09:48:16 - WeekendStudy]/Users/mobibob/Projects/workspace-weekend/WeekendStudy/res/layout/main.out.xml:1: error: Error parsing XML: no element found
[2010-03-06 09:55:29 - WeekendStudy]res/layout/main.xml:0: error: Resource entry main is already defined.
[2010-03-06 09:55:29 - WeekendStudy]res/layout/main.out.xml:0: Originally defined here.
[2010-03-06 09:55:29 - WeekendStudy]/Users/mobibob/Projects/workspace-weekend/WeekendStudy/res/layout/main.out.xml:1: error: Error parsing XML: no element found
[2010-03-06 09:55:49 - WeekendStudy]Error in an XML file: aborting build.
[2010-03-06 09:55:49 - WeekendStudy]res/layout/main.xml:0: error: Resource entry main is already defined.
[2010-03-06 09:55:49 - WeekendStudy]res/layout/main.out.xml:0: Originally defined here.
[2010-03-06 09:55:49 - WeekendStudy]/Users/mobibob/Projects/workspace-weekend/WeekendStudy/res/layout/main.out.xml:1: error: Error parsing XML: no element found
I just started a new Android project, "WeekendStudy" to continue learning Android development and I got stumped compiling the default 'hello weekendstudy' 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', the SDK is building a file main.out.xml and then fails as this:
[2010-03-06 09:46:47 - WeekendStudy]Error in an XML file: aborting build.
[2010-03-06 09:46:48 - WeekendStudy]res/layout/main.xml:0: error: Resource entry main is already defined.
[2010-03-06 09:46:48 - WeekendStudy]res/layout/main.out.xml:0: Originally defined here.
[2010-03-06 09:46:48 - WeekendStudy]/Users/mobibob/Projects/workspace-weekend/WeekendStudy/res/layout/main.out.xml:1: error: Error parsing XML: no element found
[2010-03-06 09:48:16 - WeekendStudy]Error in an XML file: aborting build.
[2010-03-06 09:48:16 - WeekendStudy]res/layout/main.xml:0: error: Resource entry main is already defined.
[2010-03-06 09:48:16 - WeekendStudy]res/layout/main.out.xml:0: Originally defined here.
[2010-03-06 09:48:16 - WeekendStudy]/Users/mobibob/Projects/workspace-weekend/WeekendStudy/res/layout/main.out.xml:1: error: Error parsing XML: no element found
[2010-03-06 09:55:29 - WeekendStudy]res/layout/main.xml:0: error: Resource entry main is already defined.
[2010-03-06 09:55:29 - WeekendStudy]res/layout/main.out.xml:0: Originally defined here.
[2010-03-06 09:55:29 - WeekendStudy]/Users/mobibob/Projects/workspace-weekend/WeekendStudy/res/layout/main.out.xml:1: error: Error parsing XML: no element found
[2010-03-06 09:55:49 - WeekendStudy]Error in an XML file: aborting build.
[2010-03-06 09:55:49 - WeekendStudy]res/layout/main.xml:0: error: Resource entry main is already defined.
[2010-03-06 09:55:49 - WeekendStudy]res/layout/main.out.xml:0: Originally defined here.
[2010-03-06 09:55:49 - WeekendStudy]/Users/mobibob/Projects/workspace-weekend/WeekendStudy/res/layout/main.out.xml:1: error: Error parsing XML: no element found
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(16)
更好的修复:
日食->窗口->首选项->运行/调试->启动-> Launch Configuration
Cross :过滤检查的启动配置类型
和 Cross 也:XSL(在列表的末尾)
Better fixing:
Eclipse -> Window -> Preferences -> Run/Debug -> Launching -> Lauch Configuration
Cross : Filter checked launch configuration types
and Cross also : XSL (at the end of the list)
是的,和我有同样的问题。
防止创建 out.xml。
编辑 XML 文件,这是一件非常自然的事情...
保存并关闭 XML 文件
打开 src/ 中的任何 .java 文件
双击该文件以确保它具有焦点并且光标位于其中。< /p>
运行...现在应该可以了
如果发生这种情况,执行此操作...
编辑 XML 文件,这是一件非常自然的事情...
运行...由于可怕的 out.xml 文件而崩溃
删除 /res/___.out.xml 文件
关闭 IDE 视图中的所有文件
项目...清理...
打开 src/ 中的任何 .java 文件
Double单击文件,使其获得焦点,光标位于其中。
双击
运行...现在应该可以了
Yeah, same problem with me.
To prevent out.xml from being created.
edit an XML file, a perfectly natural thing to do....
save and close the XML file
Open any .java file in src/
Double click in the file to ensure it has focus and the cursor is in there.
Run... should be OK now
If it happens, do this...
edit an XML file, a perfectly natural thing to do....
Run... crash due to dreaded out.xml file
Delete the /res/___.out.xml file
Close all files in the IDE view
Project...Clean...
Open any .java file in src/
Double click in the file so it has focus and the cursor is in there.
Run... should be OK now
您应该将项目作为 Android 应用程序运行,而不仅仅是单击图标--运行
You should run the project as android application not only click the icon--Run
删除了xxx.out.xml,如果还是无法运行,请按照此操作
Eclipse ->Project->Clean...->Choose your project->OK
将光标设置在 *.java 中,运行它
Deleted the xxx.out.xml, if still can't run, please follow this
Eclipse ->Project->Clean...->Choose your project->OK
Set the cursor in your *.java, Run it
由于我的工具栏未正确连接,我试图从项目的错误部分运行。我仍在研究细节,当我完全弄清楚后我会编辑它。
首先,这是我想要创建的一个新工作区,用于组织我不同的不相关项目。结果,工具栏的 RUN 没有配置目标(即在历史记录中),因此它尝试运行我的 main.xml 文件。
右键单击其中一个 *.java 文件并选择“运行为...”,然后您可以创建一个运行配置及其目标(选择或创建 AVD)、项目等。我建议访问每个选项卡并查看适合您情况的默认值。
然后,坐下来等待模拟器第一次加载(我在 Macbook 上花了大约 1 到 2 分钟)。
I was trying to run from the wrong part of the project since my toolbar was not hooked up correctly. I am still working out the details and I will edit this when I figure it out completely.
First of all, this was a new workspace that I wanted to create to organize my different unrelated projects. As a result, the RUN of the toolbar did not have a target configured (i.e., in the history), so it tried to run my main.xml file.
Right-click on one of the *.java files and select 'run as...' then you can create a run configuration with its target (pick or create an AVD), the project, etc. I recommend visiting each of the tabs and review the defaults for your situation.
Then, sit back and wait for the emulator to load for the first time (mine took about 1 to 2 minutes on a Macbook).
这似乎是 eclipse 的 XML 插件之一的问题,我认为这是 Web Tools 中的问题。我曾经能够从任何文件(无论是 XML 还是 java)运行该应用程序,但是一旦安装了 Web Tools,我就开始看到此错误。这确实很烦人,我已经习惯按 Ctrl-F11 来构建应用程序...但是如果您在 XML 文件中执行此操作,则会收到此错误。上面提到的修复确实有效,但需要右键单击项目并选择运行方式...等等,这是额外的步骤并且效率较低。如果有人想出一个干净的解决方案(当然除了删除 Web Tools 之外)来让我找回快捷键,我将不胜感激。
This appears to be an issue with one of eclipse's XML plugins, I think it is something in Web Tools. I used to be able to run the app from any file, be it XML or java, but once I installed Web Tools I started seeing this error. It really is annoying, I am so used to pressing Ctrl-F11 to build the app...but if you do that in an XML file you get this error. The fix mentioned above does work, but it is extra steps and less efficient to have to right-click the project and select Run As... blah blah. If anyone figures out a clean solution - besides removing Web Tools of course - to get me back my shortcut key I would be grateful.
我也遇到了这个问题并且很沮丧。卸载整个Android SDK并重新安装,认为存在一些问题。
令我惊讶的是,解决方案非常简单。如果将鼠标单击在 xml 文件上并转到“运行”,则会生成错误。所以解决办法很简单。单击 .java 文件或整个树的顶部(例如:如果结构是这样的:Firstapp>Src>Firstapp.java,只需单击 Firstapp),然后运行。
I encountered this problem too and got frustrated. Uninstall whole Android SDK and reinstall, thinking in mind that there was some problem.
To my surprise, solution is very simple. If you leave the mouse click over xml file and go to Run it will generate error. So the solution is simple. Click on .java file or Top of the whole tree (example: if the structure is like this: Firstapp>Src>Firstapp.java, just click on Firstapp) and then run.
@尼尔帕特尔>只是重申上面的答案......让我知道是否需要澄清。
@neil patel > Just restating the answer above ... let me know if it needs to be clarified.
我遇到了同样的问题并尝试了很多不同的事情。最后我放弃了,将整个项目树复制到另一个位置。创建一个新的Android项目并复制src文件、res.layout、res.values文件以及我在drawable下添加的自定义图像。
右键单击包资源管理器中的项目并点击“刷新”。
现在又可以了。
可能不是修复它的最佳方法,但它有效:-)
I had the same problem and tried alot of different things. Finally I gave up, copied the entire project tree to another location. Created a new Android project and copied the src files, res.layout, res.values files and my added custom images under drawable.
Right clicked the project in package explorer and hit "Refresh".
Now it works again.
Probably not the best way to fix it but it works :-)
请尝试并检查有效源是否正在运行。
删除了xxx.out.xml,如果还是无法运行,请按照此操作
Eclipse -> 项目 -> 清理...-> 选择你的项目 -> 确定
Do try, and check the valid source is running or not.
Deleted the xxx.out.xml, if still can't run, please follow this
Eclipse ->Project->Clean...->Choose your project->OK
我也可以只选择任何一个文件来运行。事情发生了变化,突然我遇到了可怕的 xxx.out.xml 解析错误。好吧,我找到了解决方法。有人请帮我确认这也适合你。
单击窗口->首选项
选择或过滤搜索“启动(运行/调试)”
在右侧窗格的底部,查找“启动操作”并选择
“始终启动先前启动的应用程序”
清理您的项目并至少正确运行一次。我对此进行了测试,它似乎始终有效。
I too was able to run with just any ol' file selected. Something changed and suddenly I was getting the dreaded xxx.out.xml parse error. Well, I found a way around it. Someone please confirm for me that this works for you too.
Click Window->Preferences
Select or filter search for Launching(run/debug)
In the bottom of the right hand pane, look for Lauch Operation and select
"Always launch the previously launched application"
Clean your project and run it correctly at least once. I tested this out and it seems to work consistently.
我遇到了这个问题,但上面的答案对我没有帮助。环顾四周后,我自己解决了这个问题,我认为我应该写下解决方案。
如果您将项目作为 XSL 运行,android 编译器会创建 *.out.xml。要解决此问题,您应该执行以下步骤:
I faced this problem but above answers do not help me. After look around, I fixed this by my self and I think I should write down the solution.
The android compiler create *.out.xml if you run the project as XSL. to fix this, you should do these steps:
如 如何阻止 Eclipse 尝试运行 XML 中所述文件?:在首选项 -> 下运行/调试->启动时,您可以选择“始终启动先前启动的应用程序”。如果您倾向于使用 Ctrl+F11 快捷键,这非常有用。
As stated in How to stop Eclipse from trying to run XML files?: Under Preferences -> Run/Debug -> Launching, you can select "Always launch the previously launched application". This is useful if you tend to use the Ctrl+F11 shortcut.
使用 eclispe 时,请确保在单击“运行”之前,项目中选择的任何文件都不是 XML 文件。这样您将永远不会收到此错误。
另外,请确保您已从工作区中删除了所有 ....out.xml。
When using eclispe make sure before clicking "Run", Any file selected in Project is not the XML file.With this you will never get this error.
Also, Make sure you have deleted all the ....out.xml from your workspace.
Eclipse ->Project->Clean...重新启动您的项目,就可以了
Eclipse ->Project->Clean...restart your project ,and that's ok
我遇到了与 wall 相同的问题,我的解决方案是:
只需再次导入它,而无需创建新项目,
请先尝试这样做:
Eclipse -> Project->Clean...->Choose your project->OK
If that没用,试试这个..
1.将项目文件夹从工作区复制到其他地方(桌面就可以)
2.从eclipse中删除项目(选中“从光盘中删除项目内容”框)
3.这次再次将项目从桌面复制到工作区
3.再次导入项目(文件>>导入>>常规>>现有项目到工作区)
4.这对我有用..
I had the same problem as wall , my solution was :
Just import it again without creating new project
first try do do that:
Eclipse ->Project->Clean...->Choose your project->OK
If that didn't work, try this..
1.copy the project folder from workspace to some where else (desktop will be fine)
2.delete project from eclipse (checked the box "delete Project content from disc" )
3.copy the project again just this time from desktop to workspace
3.import the project again (File>>Import>>General>> Existing project into workspace )
4.that's worked for me ..