Android - "Parsing Data for android-21 failed"

44,367

Solution 1

Try installing JDK 1.8 and reload Eclipse.

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Solution 2

Initially I was facing the same issue. I upgraded to JDK1.7. Still issue persist. This is due to the fact that some time eclipse takees the default sdk as 1.6. To resolve this:

  1. Change the environmental path to point 1.7/1.8
  2. Open Eclipse and goto windows tab-> preference
  3. Goto Java->complier and set Compiler compliance level to 1.7 and press apply.
  4. Then Goto Installed JRE Section. check if the installed jdk is listed and selected in the list. If not listed give the manual path using search. then select the jdk version and remove other versions in the list.
  5. in installed JRE go to execution environment and select the intended java se version and check it in compatible section
  6. Presss ok and restart Eclipse.

This should resolve the issue.

Solution 3

I tried all above mention step, but not able to solve the problem. After some research, I got Solution of my problem.

check eclipse.ini to see -vm, (like "C:/Program Files/Java/jre7/bin/javaw.exe").

i also have the problem you said and i found eclipse is started with java6. after i modify to use java7, there are no such fail dialog.

  • So need to update SDK to 1.8 or 1.7.
  • set compiler to 1.7 or 1.8..
  • then check eclipse.ini
Share:
44,367

Related videos on Youtube

warbi
Author by

warbi

Software/Android Developer

Updated on July 28, 2020

Comments

  • warbi
    warbi almost 4 years

    Had the following error in Eclipse after installing Android 5.0 (SDK 21)

    "Loading data for Android 5.0" has encountered a problem.

    Parsing Data for android-21 failed
    unsupported major.minor version 51.0

  • arberg
    arberg over 9 years
    That worked me, thanks. I used JDK1.6_45 before. I suspect installing JDK 1.7 would also work, as 1.7 has major version 51: stackoverflow.com/questions/10382929/…
  • Mike
    Mike over 9 years
    I'm confirming @arberg's guess... After getting 1.8 to work, I went back to 1.7 (u80), and that worked as well. For me, it seemed (for no reason I could figure out) that I needed to start and restart Eclipse (each JDK change required me to open Eclipse twice (and let all the build processes complete) in order for stuff to work.
  • Azurespot
    Azurespot over 9 years
    Lifesaver, thanks! To be clear, my issue came about when I transferred to a new computer. I reinstalled Eclipse and had to drag/drop my Eclipse projects into the new workspace. At first I thought it was my SDK packages were not fully installed, but then it didn't help. When trying to import a project it would have every error in the book (all red)... only adding this JDK recommended helped. I have a Mac. +1!
  • jhondge
    jhondge over 9 years
    HI @NoniA. Did you resolved it? I have same trouble with you. When I switch the eclipse workspace it's will be error.But it's will work fine that I restart my Mac then start eclipse.
  • Azurespot
    Azurespot over 9 years
    @jhondge Yes, I did! Adding that JDK helped. Although I realize I need to change to Android Studio soon, as it won't get support from Google anymore soon.
  • kingargyle
    kingargyle about 9 years
    To help prevent this in the future with the new Andmore project, which is picking up development where eclipse ADT left off, I've created the following bug bugs.eclipse.org/bugs/show_bug.cgi?id=460024. Going forward we'll probably require at least JDK 7 to run to keep compatibility with the latest SDK from Android.
  • Josh
    Josh over 8 years
    Strange as it sounds switching to 1.7, and then back to 1.6 worked for me. I picked 1.6 because my project needs to be compatible with android API 10, and 1.8 only forks with API 17 (kitkat?) and up.
  • Ryan H.
    Ryan H. over 8 years
    Yes, you need to restart Eclipse.