简体   繁体   English

解析Android L的数据失败。不支持major.minor版本51.0

[英]Parsing data for Android L failed.Unsupported major.minor version 51.0

After installing ADT Plugin for Eclipse, I tried to make a new Hello world Android app. 在为Eclipse安装ADT插件之后,我尝试制作一个新的Hello world Android应用程序。

But I met with the following error when I tried to open a new Android Application. 但是当我尝试打开一个新的Android应用程序时,我遇到了以下错误。 I'm working with JDK 7.0 and JRE 7.0. 我正在使用JDK 7.0和JRE 7.0。 I initially worked with JDK 6.0, but met with the same error, hence I uninstalled it and installed JDK 7.0 and changed the path settings respectively. 我最初使用JDK 6.0,但遇到了同样的错误,因此我卸载了它并安装了JDK 7.0并分别更改了路径设置。

The error clearly is: 错误显然是:

Loading data for Android L(Preview) has encountered a problem. 加载Android L(预览版)的数据遇到了问题。 Parsing data for Android L failed.Unsupported major.minor version 51.0. 解析Android L的数据失败。不支持major.minor版本51.0。

My compliance levels are also changed to JDK 1.7 only. 我的合规性级别也仅更改为JDK 1.7。 And I also changed my JRE compliance to 1.7. 我还将JRE合规性更改为1.7。

I was facing the same problem on my Mac OSX and for me the problem was resolved by downloading and installing JDK 1.8 from Java SE Development Kit 8 Downloads . 我在Mac OSX遇到了同样的问题,对我来说,通过从Java SE Development Kit 8 Downloads下载和安装JDK 1.8解决了这个问题。 You just need to install(or update to) JDK 1.8 and restart the eclipse. 您只需要安装(或更新) JDK 1.8并重新启动eclipse。 That's it! 而已! Should work afterwards. 之后应该工作。

Please check for the following. 请检查以下内容。

  1. Ensure that you have restarted your system after specifying the path name. 确定在指定路径名后重新启动系统。
  2. You can look for the following icon on your eclipse's layout screen. 您可以在eclipse的布局屏幕上查找以下图标。 !( !( 在此输入图像描述 ) The "20" specifies the android version to use when rendering layouts. )“20”指定渲染布局时要使用的android版本。 Change it and see. 改变它,看看。
  3. Last but not least review your ADT configurations. 最后但并非最不重要的是检查您的ADT配置。 Hope this helps. 希望这可以帮助。

You can "solve" it by uninstalling the Android L SDK using the Android SDK Manager. 您可以使用Android SDK Manager卸载Android L SDK来“解决”它。

Not satisfactory. 不满意。

Edit 编辑

I think this answer is effectively suggesting the same thing but without the uninstalling (instead just selecting the version of the API that actually works). 我认为这个答案实际上是建议同样的事情,但没有卸载(而只是选择实际工作的API的版本)。

Check your JDK version. 检查您的JDK版本。 It must be JDK1.7. 它必须是JDK1.7。 JDK 1.6 does not work. JDK 1.6不起作用。

Have had same problem when upgrading to SDK 5.0. 升级到SDK 5.0时遇到同样的问题。 As seen in different answers, the solution for me was: 从不同的答案中可以看出,我的解决方案是:

  1. Download a new JDK (1.8) 下载新的JDK(1.8)
  2. Update my Eclipse config file with the location of the new JDK: 使用新JDK的位置更新我的Eclipse配置文件:

     org.eclipse.platform --launcher.XXMaxPermSize 256m --launcher.defaultAction openFile -vm C:/jdk1.8.0_25/bin/javaw.exe -vmargs -Dosgi.requiredJavaVersion=1.6 -XX:MaxPermSize=256m 

Didn't need to modify JDK compliance. 不需要修改JDK合规性。

Just delete Android L platforms. 只需删除Android L平台即可。 Redirect to your android sdk directory. 重定向到您的Android sdk目录。

adt-bundle-mac-x86_64-20140321/sdk/platforms/android-L ADT-束-MAC-x86_64-20140321 / SDK /平台/机器人-L

delete directory android-L and restart your eclipse. 删除目录android-L并重启你的eclipse。

Sometimes it can be just because the compiler compliance level is not set properly in Eclipse Java Compiler settings. 有时它可能只是因为Eclipse Java Compiler设置中未正确设置编译器合规性级别。

Go to Eclipse Preferences, under Java section-> go to Compiler and then in JDK compliance level select 1.7 转到Eclipse Preferences,在Java section-> go to Compiler下,然后在JDK compliance level中选择1.7

I was using Eclipse Indigo 64 bit with JDK 1.7. 我在JDK 1.7中使用Eclipse Indigo 64位。 As soon as I updated to Eclipse Luna 64 bit everything worked fine. 一旦我更新到Eclipse Luna 64位,一切都运行正常。 Furthermore, Eclipse Indigo 64 wouldn't even acknowledge JDK 1.8+ 此外,Eclipse Indigo 64甚至不承认JDK 1.8+

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM