-1

http://puu.sh/69sfM ~ Screenshot

I do not have a R file in my gen folder. I have gone through many different threads and none of the presented solutions have worked. I have even tried copying and pasting the R.Java file from a different project into this gen folder but when I clean & rebuild it automatically deletes the file.

Thanks for the help in advance.

Icy
  • 17
  • 4

2 Answers2

2

Clean your project and run it.

Project---> Clean then run

see this link it gives perfect solution for you..

Community
  • 1
  • 1
balaji koduri
  • 1,321
  • 9
  • 25
  • change the build target version and clean the project, after completing that change that build version to previous. it works for me. – balaji koduri Jan 04 '14 at 19:53
1

Copying and pasting R from another project is WRONG.
R must be generated, always.

If it doesn't generate, some of your xml files contain errors (even small ones).
For instance, it can be a >> (double closing of a tag) or a wrong attribute name.
Look in EVERY xml file in your project, line by line, and you'll find the error.

Once I had this issue because of an error in strings.xml.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
  • Okay. But I've looked through every xml file and nothing is wrong. My project was working fine before I changed my background then an error occurred in my main xml. R errors popped up and even after I fixed my xml errors the R errors were not resolved. – Icy Jan 04 '14 at 19:51
  • Well, what is your background? an xml drawable or an image? Do you have a previous copy of main.xml, so that you can try if the old version works (also make a copy of the new one, to compare them)? – Phantômaxx Jan 04 '14 at 19:54
  • I actually tried changing the background back to white to see if the issue would resolve itself but it didn't work. And I added the image as an xml drawable. – Icy Jan 04 '14 at 20:04
  • Did you double check every line, for the smallest error? Sometimes errors are so good in hiding, you know... also check your menu.xml, your preferences.xml, EVERY xml you have in your project - you never know where the error hides – Phantômaxx Jan 04 '14 at 20:08
  • Okay, is it possible that they will not show as errors sometimes? – Icy Jan 04 '14 at 23:48
  • Yes, it can happen that **sometimes the errors aren't marked** – Phantômaxx Jan 05 '14 at 09:37
  • It turns out that I had added an image into my drawables that had an uppercase letter haha. Thanks for the help. – Icy Jan 07 '14 at 00:06
  • Wonderful that you killed the bug! ;) – Phantômaxx Jan 07 '14 at 18:39