Developing for Android in Eclipse: R.java not regenerating

前端 未结 30 3131
孤城傲影
孤城傲影 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:05

    As a generalization of Glaux's answer, if you have any errors in the res directory, then R.java may not generate - even if you clean and rebuild. Resolve those errors first.

    As an example: when you add an image file of say, "myimage-2.jpg", the system will consider this an error, since file names are limited to alphanumeric values. Do a refresh on your 'res' directory after adding any files and watch the output in your console window for any file name warnings.

提交回复
热议问题