mitchnufc
mitchnufc

Reputation: 309

Android R Cannot be resolved issue

I have just been working on my android project in eclipse and all of a sudden this error appeared, my manifest file matches the name of my application etc.............!

What I have noticed is that that the auto generated Java files are missing from the gen folder its completely empty now.

orginally I had to create a default.properties file as there wasn't one present and it was working fine uptil the point i tried to add a button into one of my xml files. Tried to clean project too and that hasn't resolved the issue either.

Any ideas?

Upvotes: 2

Views: 1447

Answers (3)

Thkru
Thkru

Reputation: 4199

use "Project" -> "Clean" in Eclipse to re-generate your R file and fix other android issues. ...sometimes this helps a lot! ;D

Upvotes: 0

Rafiq
Rafiq

Reputation: 2000

Remove the gen folder from Project Name ->Properties -> Java Build Path ->Source. You will get an error message after removing it. Now Add the gen folder again in the same way. You can now see the R class. If the problem remain, then try to remove both src and gen; add them again.

Upvotes: 0

Bobbake4
Bobbake4

Reputation: 24857

This error is usually caused because you have an error in one of your resources. Check to make sure that there are no errors in the xml resource files or the drawable directories. In the list of errors you are seeing you should look at the top most error and see if you can resolve this. What tends to happen is that an error in one of your resource files is causing the generation of the R file to fail. Once the R file fails to generate you will see a huge list of errors but they are all caused by the one error.

Upvotes: 2

Related Questions