2

I have searched for a solution to my problem on stack overflow . Before marking this question as duplicate, please understand that I have tried all the possible solutions that were posted, but I still have the above errors. I am running the default Hello World android program, so haven't made any changes in the code . The Minimum supported sdk version=8,Target build = sdk android API 21, Compiler sdk= android API 21 and Environment: Eclipse Juno.

Things that I tried : -

  1. I have deleted appcompat v4.jar from the appcompat workspace folder, which leaves me with just appcompat v7.jar

  2. I have added appcompat_support_v7.jar as external jar.

  3. I have tried refreshing, restarting eclipse and cleaning but errors still persist. Error being: "R cannot be resolved to a variable Type: Java Error".

  4. For android 5, JRE 1.8 is needed so I have installed that and set the windows environment variable to the path where jdk1.8 is saved. i.e. JAVA_HOME=C:\Program Files\Java\jdk1.8.0_31

  5. Using cmd when i do echo %JAVA_HOME% it prints the above path. Though I am still unable to run java programs from cmd using 'javac'.

  6. I have then set the path for jdk1.8 by going to Eclipse, window>preference>java>installed jres , the path being : C:\Program Files\Java\jre1.8.0_31

  7. I have also then gone to Eclipse, window>preference>java>installed jres>execution environment and checked the compatiability of SE 8.

  8. Even after restarting Eclipse, the first error I get is : "Parsing Data for android-21 failed Unsupported major.minor version 51.0". and at the bottom in the problems tab ,the error I get is :

"R cannot be resolved to a variable - Java Error"

  1. My Android Support library is up to date and I have installed all the necessary packages using SDK manager for Android API 17 and 21 .

Please note that I have JRE 6 ,7 and 8 installed on my computer because I am using those versions in another eclipse for J2EE, but in eclipse (Juno) for android I have set the path for jdk 1.8.

I think it has got something to do with Java installation, but I don't understand what exactly I have done wrong. It would be great if you could help me out. Thanks in advance.

2
  • Since you are new to Android development. Please use Android Studio as it is the official IDE for Android development. Commented Feb 14, 2015 at 7:15
  • I was stuck at same issue but problem is in one of my XML file. it looks nice but looking carefully I saw something @drawable@drawable/R.draw.. .. So check your recently edited XML's and also is R.java file generating? If not then must look in XML's Commented Feb 15, 2015 at 11:55

2 Answers 2

1

As you did not mention this in your checklist I was wondering: did you make sure that you do not have any uppercase letter in your resources file names? For example if you have a drawable named myIcon.png, you should rename it my_icon.png

I spent hours with a completely broken project just because of that, I wish this could be as simple in your case!?

Sign up to request clarification or add additional context in comments.

1 Comment

Yes I do not have any uppercase letter in any file name for the files contained within the folders in res .
0

1) Check that appcompat_support_v7.jar really is pointing to the right location by going under project -> properties.

2) Clean (even though you've done it already)

1 Comment

Yes, on going to Project>Properties>java BuildPath , android-support-v7-appcompat.jar is pointing to the correct location where the jar file is actually located i.e. in C:\Program Files\android\sdk\extras\android\support\v7\appcompat\libs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.