Error in XML file reporting and aborting assembly

When I edited res / layout / main.xml and tried to restart the build of the application. The following error message appears:

[2011-05-28 08:56:04 - MyWebApps1] res\layout\main.xml:0: error: Resource entry main is already defined. [2011-05-28 08:56:04 - MyWebApps1] res\layout\main.out.xml:0: Originally defined here. [2011-05-28 08:56:04 - MyWebApps1] C:\Users\Toshiba\Documents\android\MyWebApps1\res\layout\main.out.xml:1: error: Error parsing XML: no element found [2011-05-28 08:56:07 - MyWebApps1] Error in an XML file: aborting build. 

The main.xml file has been edited correctly. There is no syntax error. Does anyone have an idea?

+4
source share
4 answers

You pressed F11 to start the application, but while on main.xml, and because of the Eclipse configuration, it launched the XML file, creating .out.xml. Just delete it.

+6
source

You need to remove main.out.xml in res/layout/ and then clean up the project.
If you are working on an Eclipse IDE, follow these steps: Project ==> Clean ==> check your project and click OK.

+4
source

You should open the file "MainActivity.java" and try to run it again

+2
source

Stop deleting your .out.xml!

Although it is true that it will “fix” your problem, it will cause other problems, especially if you are developing and working with the user interface with the tab “graphic layout” in Eclipse. What happens is that you start the configuration, mixed up, you go to run it, but try to run .out.xml so that it does not work. The solution should not start deleting files.

Click the green circle to the right of the “run” button to display a list of options and select “Run configurations”. Configure it for an emulated Android device. When you run the code, use this custom run. Also, run java from the main file.

+2
source

All Articles