1

I am doing an application in which I didnt changed anything and still it is giving me an error on R.java file that R cannot be resolved to a variable...

I have done all the things like: project->clean

close and open the project again

close the eclipse and restart it agagin but no solution...

I am not able to fix this problem....This problem is so much irritating....Can anyone pls help me in this case??

8
  • check which R file has got included into your class if it is android.R then remove it and import your R class Commented Dec 27, 2011 at 11:00
  • check any import's in the project with com.--.R (like this) delete that and refresh. project Commented Dec 27, 2011 at 11:01
  • no,..it doesn't have any of the import on R.. Commented Dec 27, 2011 at 11:06
  • @ShabbirPanjesha: no..its not android.R....I want to add my own project R.java file...But as this file is auto generated...and will generate when I am compiling my project..but due to these errors I am not able to compile Commented Dec 27, 2011 at 11:07
  • then definitely one of your xml file contains error or not well formed. Commented Dec 27, 2011 at 11:10

2 Answers 2

3

There is probably an error in one of your resource files, you need to properly check all your resources to find if any of them contain errors. The resource with an error will have an error red cross on its icon. Hope this helps.

Sign up to request clarification or add additional context in comments.

Comments

1

Make sure there are no other errors that might cause this error, also look at this entry:

R cannot be resolved - Android error

2 Comments

I ahve tried all the methods mentioned here,but still didn't get anything
last time I have seen this error I have misspelled android name in android:id in one of the widget. If your project have not changed then maybe you have made changes to filesystem? changed permissions, folder names, etc.?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.