Developing for Android in Eclipse: R.java not regenerating

前端 未结 30 3105
孤城傲影
孤城傲影 2020-11-21 07:04

I\'ve found out that my R.java is never updated, so it doesn\'t contain information about my new resources, so I decided to delete it and thought that Eclipse would generate

30条回答
  •  南方客
    南方客 (楼主)
    2020-11-21 08:06

    In Eclipse, simply use Project --> clean to clean the project. The R.java is going to be automaticly (re)-created.

    If for some reason that dosn't work: Make sure your layout.xml files don't contains errors. Eclipse seems to be a bit buggy here: sometimes it doesn't mark the errors within the XML nor the package explorer. In such a case: Take a look at the "console" or "problems" view after using "clean". All errors should be displayed there. Fix them and redo a clean.

    NOTE: It is NOT neccessary to fix the errors you get because of a missing R file! Just fix the XML files and other project errors and use clean!

提交回复
热议问题