0

This is the detailed version of what happened. Please have a little patience and read this. I think my problem is unique.

Initially I had installed Eclipse and followed all procedures and was happily coding my first app. One fine day I fired up the SDK manager and saw the Android Tools had a new update. I tried to install the package. Then may be due to my slow net, something went wrong and Eclipse didn't work at all. It said there was something wrong in some file as an error message.

So I installed Eclipse again and followed all procedures. The address of the workspace and the Android SDK was kept same so that my projects will be automatically imported. But now Eclipse is underlining the R or Resource references in my src files. I do not know what to do.

rrrocky
  • 696
  • 1
  • 11
  • 27
  • I just realized something! The gen folder which contains the Java Generated File is totally empty! How did that happen?!! – rrrocky Jun 21 '13 at 03:46
  • check http://stackoverflow.com/questions/885009/r-cannot-be-resolved-android-error – koem Jun 21 '13 at 03:52
  • Check your XML.....see that the resource names are proper...no caps.. – ASP Jun 21 '13 at 04:08
  • Didn't work out. I think I have different problem. I even created a new workspace and imported my project. But still the problem persists. – rrrocky Jun 21 '13 at 04:22
  • Checked everything. Everything seems to be in place. – rrrocky Jun 21 '13 at 04:23
  • If any of your XML resources has a compilation error, R will not be generated and all your java classes will show an error (because they cannot resolve the import). – Karakuri Jun 21 '13 at 04:27
  • What Karakuri said. If all of your xml resources are OK, you should be able to delete R.java and a new one will be automatically generated. – Rob K Jun 21 '13 at 04:49
  • Check if your src have any 'android.R' imports. Change it to '(project).R' e.g. 'com.package.test.R' – The Badak Jun 21 '13 at 05:30

1 Answers1

1

Did you try opening the sample project that is shipped with andoid SDK? If even that one has the problrm, I think you must update ADT plug-in. Updating SDK and not ADT plug-in caused the problem for me. Once I updated ADT plug-in, everything worked fine.

Naresh
  • 3,174
  • 1
  • 17
  • 22