-2

What i did:

  • I downloaded: XYPlot and added the jar to my libs folder
  • I added this example: Quickstart to my project
  • I startet the App: Everything worked
  • I closed Eclipse
  • I opened Eclipse
  • My R was gone

What i tried to fix this problem:

  • I restarted eclipse
  • I cleaned the Project
  • I deleted the Project from Eclipse and reimported it
  • I used Android-Tools to fix the properties
  • I checked if there are uppercase letters in some Layout-Files or Drawables, etc.
  • I also checked all other invalid characters.
  • I made sure that there is no other R imported by any of my files

Nothing solved the problem

My min and target sdk:

<uses-sdk
    android:minSdkVersion="13"
    android:targetSdkVersion="19" />

Does someone had the same issue? Where is R located and how can i recreate it?

Ok i figured out that even when i create a completely new project the R of the new Project cant be found. What is going on there?

Mulgard
  • 9,877
  • 34
  • 129
  • 232
  • Select `Build Project` in project menu. – Misagh Emamverdi Nov 19 '14 at 09:40
  • what error do you get when you try to clean / build the project? – Jim Nov 19 '14 at 09:42
  • no there arent other invalid characters either. actually i didnt change them when i added XYPlot and it worked before. I cant use Build Project in projects menu. Dont know why my post gets downvoted. i tried all provided solutions without success. – Mulgard Nov 19 '14 at 09:45
  • please check project resource there some problem in resource. – Haresh Chhelana Nov 19 '14 at 09:46
  • one layout is complaining about that it cant find my drawables. but everything is okay with my drawables. i guess the source of that problem is related to the missing R. – Mulgard Nov 19 '14 at 09:48
  • No, nothing helps. even if i create a completely new project the R of the new project cant be found – Mulgard Nov 19 '14 at 10:06

2 Answers2

0

You probably have a typo (unclosed tag, missing hyphen, comma, dot or other error like wrong package name in the manifest) somewhere in one of your XML files, either in the manifest.xml or in strings, or layout. Check them.

  • No, nothing helps. even if i create a completely new project the R of the new project cant be found – Mulgard Nov 19 '14 at 10:02
  • (R is not generated when there is a mistake in any of the xml files. It doesn't matter how many times you create a new project or reimport the existing one or you copypaste the faulty xml.) If xml isn't the problem, what ide are you using? – user2840243 Nov 19 '14 at 10:06
  • Oh i guess it does matter. when there is an complete empty workspace and i create a complete new android project, why should there be any faulty xml? – Mulgard Nov 19 '14 at 10:07
  • Hm. In that case it shouldn't matter. If you use Eclipse have Build Automatically checked in Project menu. If that doesn't help check this answer(and the others): http://stackoverflow.com/questions/16642604/eclipse-error-r-cannot-be-resolved-to-a-variable/16643060 – user2840243 Nov 19 '14 at 10:18
0

R file doesn't gets recreated whenever there is some error in the code, since the xml files present in the values folder don't get auto-checked for errors so generally the problem lies in those files.

Sarthak Mittal
  • 5,794
  • 2
  • 24
  • 44
  • Yes i know that but i completely erazed my workspace and created a completely new and basic android application project. the automatically created hello world cant also find the R. So something is very wrong there. – Mulgard Nov 19 '14 at 10:10
  • Did you tried restarting your eclipse or maybe your computer? or did you updated your android sdk recently or something? – Sarthak Mittal Nov 19 '14 at 11:10