android sdk main.out.xml parsing error?

XmlParsingAndroidAvd

Xml Problem Overview


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

Xml Solutions


Solution 1 - Xml

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)

Solution 2 - Xml

Yeah, same problem with me.

To prevent out.xml from being created.

  1. edit an XML file, a perfectly natural thing to do....

  2. save and close the XML file

  3. Open any .java file in src/

  4. Double click in the file to ensure it has focus and the cursor is in there.

  5. Run... should be OK now

If it happens, do this...

  1. edit an XML file, a perfectly natural thing to do....

  2. Run... crash due to dreaded out.xml file

  3. Delete the /res/___.out.xml file

  4. Close all files in the IDE view

  5. Project...Clean...

  6. Open any .java file in src/

  7. Double click in the file so it has focus and the cursor is in there.

  8. Run... should be OK now

Solution 3 - Xml

You should run the project as android application not only click the icon--Run

Solution 4 - Xml

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

Solution 5 - Xml

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).

Solution 6 - Xml

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.

Solution 7 - Xml

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.

Solution 8 - Xml

@neil patel > Just restating the answer above ... let me know if it needs to be clarified.

> 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.

Solution 9 - Xml

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 :-)

Solution 10 - 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.

Solution 11 - Xml

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

Solution 12 - 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.

Solution 13 - 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:

  • click on the arrow at right side of Run button, select Run Configurations. At the left side of popup windows, delete all sub-items under XSL.
  • go to Launch configuration under preferences=>Run/debug =>Launching. Check to "Filter checked launch..." and then, uncheck XSL when keeping check on Android Application.

Solution 14 - Xml

As stated in https://stackoverflow.com/questions/2171031/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.

Solution 15 - Xml

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 ..

Solution 16 - Xml

Eclipse ->Project->Clean...restart your project ,and that's ok

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionmobibobView Question on Stackoverflow
Solution 1 - XmlHugo Garcia-CotteView Answer on Stackoverflow
Solution 2 - XmlBerry WingView Answer on Stackoverflow
Solution 3 - XmlwangView Answer on Stackoverflow
Solution 4 - Xmluser383343View Answer on Stackoverflow
Solution 5 - XmlmobibobView Answer on Stackoverflow
Solution 6 - XmlestittView Answer on Stackoverflow
Solution 7 - XmlAnandView Answer on Stackoverflow
Solution 8 - XmlmobibobView Answer on Stackoverflow
Solution 9 - XmlWekeView Answer on Stackoverflow
Solution 10 - XmlR HughesView Answer on Stackoverflow
Solution 11 - Xmluser366584View Answer on Stackoverflow
Solution 12 - XmlJhaView Answer on Stackoverflow
Solution 13 - XmlNguyen Minh BinhView Answer on Stackoverflow
Solution 14 - XmlpypmannetjiesView Answer on Stackoverflow
Solution 15 - XmlZoharAdarView Answer on Stackoverflow
Solution 16 - XmlzclmoonView Answer on Stackoverflow