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 : -
I have deleted appcompat v4.jar from the appcompat workspace folder, which leaves me with just appcompat v7.jar
I have added appcompat_support_v7.jar as external jar.
I have tried refreshing, restarting eclipse and cleaning but errors still persist. Error being: "R cannot be resolved to a variable Type: Java Error".
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
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'.
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
I have also then gone to Eclipse, window>preference>java>installed jres>execution environment and checked the compatiability of SE 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"
- 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.
@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