R.java file disappears while importing image and sound files to the raw and layout folders in resource in eclipse. How to fix the bug and bring back the missing R.java file?
4 Answers
It can be several problems, from my personal experience I suggest the following:
- Check for errors in all files when attempting a build (I know this is basic, but I have to mention it anyway)
- Check for errors in layouts
- Check for errors in file names (like '@' or other incompatible characters for file/resources names).
- Don't do 'import android.R.java' anywhere
- Check the Android properties of the project on Eclipse, and see that both the properties and the Manifest have the same version target.
- On the manifest, check that the package name is correct (it can happen if you are copying/pasting code from another project, that you forget to correct this on the manifest, and it will just mark a general error on the project but not specifically on the Manifest.xml)
After all that, do Project->Clean, then Build.
PS.: Another thing I suggest is unchecking the automatic build option.