Reputation: 1707
I was working on an android project and i pressed project->clean in eclipse and my R.java source file disappeared.Would anyone know the reason why
Upvotes: 0
Views: 137
Reputation: 29632
Go to the Project Menu and select the option "Build Automatically". Probably this option was not "ticked" in your case. This is the reason when you clean your project eclipse hasn't created R.java again.
Upvotes: 2
Reputation: 1200
did you try to find it? I have a similar problem once. Because, eclipse program imported a library R.something so I just removed it and then clean project. and my R file appeared again
Upvotes: 0
Reputation: 6728
Whenever any project is cleaned, all the automatically generated files are deleted (hence your R.java got deleted), which is automatically generated again when the project is build successfully. Now, in your case R.java can't be generated which means there is some error in your resource - either in your xml files or drawables. These kinds of errors are shown in the console while you are trying to build the project
Upvotes: 0
Reputation: 7403
This file is dynamically generated, just Build the project again and it'll show up.
Upvotes: 1
Reputation: 76909
Ensure there are no errors in your resource files (a bogus layout, drawable or whatever).
Ensure the "Automatically build" option is set in the project menu.
Try cleaning the project again.
Try right-clicking the project -> Android tools -> fix project properties.
Try manually building it.
If that didn't work, try restarting Eclipse.
If that didn't work, try running eclipse -clean
If that didn't work, try deleting the project without deleting the files, and re-importing it.
If that didn't work, well. I've no idea.
Upvotes: 0