Android App "R file" disappears

Source: Internet
Author: User

In fact, Android own maintenance of this public final class R class is mainly with the new resource file, this R.java without our own to modify, if you do not understand do not modify it, it defines the value of each resource is unique, does not conflict with the system. This file is automatically updated by the ADT plugin, and when you edit the res file, the class is automatically updated.

R.java typically have attr, drawable, ID, raw, Layout, string, and XML, depending on the resources you use for your project. This needs to be rebuilt when the R.java file is lost, but there may be problems, such as resources not being updated automatically.

Solve

    1. 1

      Select "Eclipse-myeclipse" clean, The R file will appear.

    2. 2

      Click the right mouse button on the project, select "Build project" and R.java will reply. This allows you to invoke the resources that the r file points to in your program, and you can automatically complete it.

    3. 3

      Copy an R file from another project, then change it in string.xml and clean it, or update the R file.

    4. 4

      If none of the above steps are possible. It is possible that the project itself caused errors, such as the naming of files in Resoure resources, such as Result_main.xml, and if written result_main.xml is wrong, the resource file name needs to be all lowercase.

       

      Source: http://jingyan.baidu.com/article/fc07f98917046f12ffe51929.html

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.