Reputation: 1585
I think these posts are the best here on stackoverflow that are related to my issue:
“R cannot be resolved to a variable”?
R cannot be resolved - Android error
I tried every answer on those posts, but I still didnt fix my "R cannot be resolved to a variable" error. I'm really desperate at this point. The interesting part is that I had yesterday the same problem and I fixed it with the clean project + restart IDE method, but today it's not working. I never had this problem until I updated my ADT to ADT 21.1.0. I know that my res files are not allowed to have any errors, but they have some warnings. Are those warnings coausing the problem?
Upvotes: 1
Views: 437
Reputation: 1
Sometimes it will happen when memory cache not cleared previous data . Just simply clear your project then it will worked .
procedure : In eclipse go project then you will see clear ...
then press clear and select your project and press ok . hope it will work. best of luck
Upvotes: 0
Reputation: 1655
R.java
is deleted whenever there exists any compile error in res/
folder or in AndroidManifest.xml
file. You have to check every files in res/
folder and AndroidManifest.xml
to fix the problem.
Upvotes: 4