The main. Out. xml file is generated during Android program debugging.

Source: Internet
Author: User

I recently started to learn about Android and found several demos to study the functions of Android.CodeStructure.

 

When debugging a demo today, I modified the layout file layout \ main. xml and run Ctrl + F11. the following error is returned:

[16:48:10-listviewdemo] error in an XML file: Aborting build.
[16:48:10-listviewdemo] res \ Layout \ main. xml: 0: Error: resource entry main is already defined.
[16:48:10-listviewdemo] res \ Layout \ main. Out. xml: 0: originally defined here.

  

At the same time, an empty main. Out. xml file is generated in the layout Directory, which is strange.

  

Later I found it was an eclipse problem. After modifying main. XML, the currently activated tab page is still main. XML, so eclipse will convert the XML file using XSLT by default.

To solve this problem, first Delete the main. Out. xml file in the layout directory, and then select project> clean to rebuild the current project. In package exploer, right-click the current project and choose run as> Android Application to run the project. Or open the Java file of any current project. Press Ctrl + F11 to display the run as dialog box. Select Android Application.

  

After a project is run, the project that has been run appears in the run as drop-down box on the toolbar. You can click the drop-down menu to run the project. The projects that have run previously can be run-> RUN deployments in the menu. the dialog box is as follows:

  

Here, we can see that main. xml also appears under the XSL node, and you can delete them.

  

I always think this is too much trouble, because the layout file is often changed and the shortcut keys are often used. You cannot switch the focus to another Java file every time you change main. XML, or click the mouse.

Later, we found that we can configure it in eclipse. Choose Windows> preference from the menu, select node run/debug> lauching, and select the first item for lauch operation.

 

 

In this way, even if the current edited file is XML, the XML file will not be converted, but the project that has been run before will be run, the premise is that the current project has run once and the main. XML, Main. XML (1) and other useless deletions.

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.