0

I am unable to see the R.Java file in my gen folder after clean the project. I restarted Eclipse, Restarted system, changed workspace also no use, created new project but that new project also not generating R.Java file. How can I get out of this problem. This problem eats my time can any one please keep me out of this...

yamuna
  • 41
  • 1
  • 9

7 Answers7

4

if none of above solutions worked for you. Then try this- Basically R.java is generated to give references to all layouts and other buddies in our app. So, your IDE will not re-generate it after clean if there are 'any' type of bugs or errors in your layouts(.xml's). Click here for reference. So, look deeply into your .xml's whether there are any invalid or unexpected entries there? This should work for you if updating your JDK and ADT tools didn't worked for you. Good Luck :)

Perry
  • 244
  • 3
  • 15
  • 2
    @yamuna, There might not be necessarily red cross errors. Mistakes in your xml views could cause the R.java not to be generated. Go through your view files **manually** and make sure all the xml is right! Also check whether you satisfy naming conventions under _res/_ folder. This could also be a reason. – Perry Dec 30 '14 at 05:57
1

I also got the same error once and solved it by just downloading the latest jdk 1.8 Have a look on the following link:

Android - "Parsing Data for android-21 failed"

Hope it helps.

Community
  • 1
  • 1
Pihu
  • 1,041
  • 11
  • 35
1

Check in your drawable .. is there any drawable present with capital casing.. as name should be lower case,0-9 or _ . I too had this issue and after 2 hours i got this result. phew!

Rohit
  • 810
  • 2
  • 9
  • 34
  • Check if you are using any project as library and added to your project, both should have same sha1 code too. – Rohit Dec 30 '14 at 05:20
  • I used only paypal library no other project libs – yamuna Dec 30 '14 at 05:24
  • sha1 code for both should be same means "android-support-v4.jar" should be same in both – Rohit Dec 30 '14 at 05:36
  • There is no Sha1-1 for lib? – yamuna Dec 30 '14 at 05:37
  • android-support-v4.jar in both project should be same so copy it paste to other one and then check! – Rohit Dec 30 '14 at 05:39
  • paypal lib is just i place in libs folder and add to buildpath.. Its worked up to yesterday evening after i cleaned project R.java disapperas – yamuna Dec 30 '14 at 05:40
  • Only solutions now :- Created new project and copied the files or restart Eclipse, computer and check.. – Rohit Dec 30 '14 at 05:44
  • What works for some is to delete the "gen" directory then clean and rebuild. Worked for many developers. – Rohit Dec 30 '14 at 05:46
0

try to download "Android SDK build-tools" package from the SDK manager without this package eclipse will not generate R.java and restart eclipse. hope that will help

Ahmad Sanie
  • 3,678
  • 2
  • 21
  • 56
  • I already downloaded Android SDK build-tools and restarted yesterday. But problem not solved – yamuna Dec 30 '14 at 03:59
  • You must add it as a library: https://developer.android.com/tools/support-library/setup.html Also, I personally have to go to the project's properties -> Android -> Library section (bottom half) -> Add... -> android-support-v7-appcompat Also, you may have to specify Project Build Target as 21 (Lollipop).. – Über Lem Dec 30 '14 at 04:00
  • I have target as 21 and added the appcompat lib also.. but no change – yamuna Dec 30 '14 at 04:05
0

Parsing Data for android-21 failed Unsupported major.minor version 51.0 " while restarting or launching eclipse

You need to download latest jdk 1.8.Then set java 1.8 to your eclipse and you may not get this error message.

Reference : Android - Parsing Data for android-21 failed

Hope it helps you ツ

Community
  • 1
  • 1
SweetWisher ツ
  • 7,296
  • 2
  • 30
  • 74
  • oracle.com/technetwork/java/javase/downloads/… I installed jdk-8u25-windows-i586.exe also – yamuna Dec 30 '14 at 04:22
0

Have you checked eclipse > project > build automatically. This should be checked.

Sar
  • 550
  • 4
  • 18
0

I know this is too late, but i'm writing this to help those who reach to this page on having same issue. I also got the same issue, i found some errors in my res/values/style.xml files. After fixing them, I again cleaned my project and "R" file generated :)