Eclipse Android SDK - 构建工作区时出现错误

8
我已经使用Android SDK Manager更新了我的软件包,并单击“帮助”>“检查更新”并更新已安装的插件。我被提示重新启动eclipse,现在重新启动后,
我得到以下错误代码:
'Building workspace' has encountered a problem.
Errors occurred during the build

Errors occurred during the build.
Error instantiating builder 'com.android.ide.eclipse.adt.ResourceManagerBuilder'.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.ResourceManagerBuilder.
Bad version number in .class file
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.ResourceManagerBuilder.
Bad version number in .class file
Error instantiating builder 'com.android.ide.eclipse.adt.PreCompilerBuilder'.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.
Bad version number in .class file
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.
Bad version number in .class file
Error instantiating builder 'com.android.ide.eclipse.adt.ApkBuilder'.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.
Bad version number in .class file
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.
Bad version number in .class file
Error instantiating builder 'com.android.ide.eclipse.adt.ResourceManagerBuilder'.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.ResourceManagerBuilder.
Bad version number in .class file
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.ResourceManagerBuilder.
Bad version number in .class file
Error instantiating builder 'com.android.ide.eclipse.adt.PreCompilerBuilder'.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.
Bad version number in .class file
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.
Bad version number in .class file
Error instantiating builder 'com.android.ide.eclipse.adt.ApkBuilder'.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.
Bad version number in .class file
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.
Bad version number in .class file
Error instantiating builder 'com.android.ide.eclipse.adt.ResourceManagerBuilder'.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.ResourceManagerBuilder.
Bad version number in .class file
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.ResourceManagerBuilder.
Bad version number in .class file
Error instantiating builder 'com.android.ide.eclipse.adt.PreCompilerBuilder'.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.
Bad version number in .class file
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.
Bad version number in .class file
Error instantiating builder 'com.android.ide.eclipse.adt.ApkBuilder'.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.
Bad version number in .class file
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.
Bad version number in .class file
Error instantiating builder 'com.android.ide.eclipse.adt.ResourceManagerBuilder'.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.ResourceManagerBuilder.
Bad version number in .class file
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.ResourceManagerBuilder.
Bad version number in .class file
Error instantiating builder 'com.android.ide.eclipse.adt.PreCompilerBuilder'.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.
Bad version number in .class file
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.
Bad version number in .class file
Error instantiating builder 'com.android.ide.eclipse.adt.ApkBuilder'.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.
Bad version number in .class file
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.
Bad version number in .class file
Error instantiating builder 'com.android.ide.eclipse.adt.ResourceManagerBuilder'.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.ResourceManagerBuilder.
Bad version number in .class file
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.ResourceManagerBuilder.
Bad version number in .class file
Error instantiating builder 'com.android.ide.eclipse.adt.PreCompilerBuilder'.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.
Bad version number in .class file
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.
Bad version number in .class file
Error instantiating builder 'com.android.ide.eclipse.adt.ApkBuilder'.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.
Bad version number in .class file
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.
Bad version number in .class file
Error instantiating builder 'com.android.ide.eclipse.adt.ResourceManagerBuilder'.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.ResourceManagerBuilder.
Bad version number in .class file
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.ResourceManagerBuilder.
Bad version number in .class file
Error instantiating builder 'com.android.ide.eclipse.adt.PreCompilerBuilder'.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.
Bad version number in .class file
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.
Bad version number in .class file
Error instantiating builder 'com.android.ide.eclipse.adt.ApkBuilder'.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.
Bad version number in .class file
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.
Bad version number in .class file
Error instantiating builder 'com.android.ide.eclipse.adt.ResourceManagerBuilder'.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.ResourceManagerBuilder.
Bad version number in .class file
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.ResourceManagerBuilder.
Bad version number in .class file
Error instantiating builder 'com.android.ide.eclipse.adt.PreCompilerBuilder'.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.
Bad version number in .class file
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.
Bad version number in .class file
Error instantiating builder 'com.android.ide.eclipse.adt.ApkBuilder'.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.
Bad version number in .class file
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.
Bad version number in .class file
4个回答

8

我曾经遇到过相同的错误。我再次检查了sdk更新并安装了它们,在eclipse中,我检查了更新(帮助->检查更新)。 重新打开eclipse后,现在一切都恢复正常了。希望这能帮到你。


搜索两个小时后找到的解决方案。你可能会遇到ADT > v. 22的库问题 --> https://dev59.com/kGQn5IYBdhLWcg3wvpUV - philipp

4

您确定已经安装了正确的依赖项吗?您安装了哪个版本的eclipse?使用哪个JRE/JDK来运行eclipse?

Bad version number表示目标Java版本与您使用的版本不匹配(请参见此处)。


在进行这些更新之前,我的环境很好。我安装了Eclipse版本:3.6.2。在“窗口”>“首选项”中,JDK编译器兼容级别为1.6。如何纠正Java版本不匹配的问题?我参考了您提供的链接,但我不知道该怎么做。 - Surekha
预期使用的是我发布的第一个链接(1.6)中说明的版本。您可以使用命令“java -version”找到正在使用的版本。但是,Eclipse启动器可以使用任何安装的虚拟机,因此这可能不会给出正确的答案。看起来ADT 17.0.0是需要Java 1.6的第一个版本。 - Stefan Hanke
在网上搜索了一段时间后,我认为问题出在ADT版本17上,正如这里所提到的。 - Surekha
看起来有点不同,不过你也应该升级SDK。嗯,到目前为止我一直在使用ADT 16,现在已经更新到ADT 17了。ADT直接警告我也要更新SDK;好吧,我现在用的是MacOS X... - Stefan Hanke
非常感谢 Stefan,它起作用了!我将 -vm 更改为指向 jre6 而不是 jre1.5.0_22。 - Surekha
显示剩余4条评论

0
我在我的一个项目中遇到了一些错误。我只是简单地切换工作区,问题就解决了。
打开Eclipse。转到文件菜单 -> 切换工作区 -> 其他并创建一个新的工作区路径。然后你就可以开始了。

0

在我的情况下,计算机重新启动解决了所有问题,而无需重新安装ADT插件。 顺便说一句,我正在使用MAC + ADT_v22


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接