-3

Possible Duplicate:
R cannot be resolved - Android error

I got an error "R-can not be resolved as Variable". I noticed there is a class file called "R" in android. I can able to import that R class file import.android.R;.
Is this R is mandatory one. Is this R related with any layout.

Community
  • 1
  • 1
vinothvetrivel
  • 109
  • 3
  • 10

2 Answers2

0

check is there import android.R; in your import section. if there delete that import statement

Ram kiran Pachigolla
  • 20,897
  • 15
  • 57
  • 78
  • Thank you for giving some suggestion.It started work fine. In Eclipse if you try to use Android API-15 it generate two layout file. If you delete one end with "_out" your application will work fine. – vinothvetrivel Jul 10 '12 at 13:09
0

Is this on Eclipse? Apparently something is getting in the way of your resources being compiled. This happens quite a lot. Some tips from my experience:

1) Changing verbosity settings for the Android builder, in preferences. Then you can check console for resource generation errors.

2) Sometimes the resource generation doesn't give good errors. For example if you changed the res directory structure into an illegal one it sometimes will fail without a proper error. Compare your project to a working project.

3) Sometimes the Eclipse Android plug-in seems to be stuck in a broken state, an Eclipse restart usually works.

yotam.shacham
  • 307
  • 2
  • 10
  • Thank you for giving some suggestion.It started work fine. In Eclipse if you try to use Android API-15 it generate two layout file. If you delete one end with "_out" your application will work fine. – vinothvetrivel Jul 10 '12 at 13:06