Android ADT Eclipse 插件,parseSDKContent 失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2694259/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 14:38:54  来源:igfitidea点击:

Android ADT Eclipse plugin, parseSDKContent failed

androideclipseadt

提问by Sebastian Ganslandt

I've just set up my first Android development environment consisting of

我刚刚建立了我的第一个 Android 开发环境,包括

  • Eclipse 3.5
  • Mac OSX 10.5
  • Android SDK for x86 macs
  • ADT Eclipse plugin 0.9.6
  • 日食 3.5
  • Mac OSX 10.5
  • 适用于 x86 mac 的 Android SDK
  • ADT Eclipse 插件 0.9.6

I've set set $PATH to my SDK/tools directory (which shouldn't matter if I only use Eclipse right?) and started Eclipse, but when I try to set the path to the SDK in Eclipse, i get the error "parseSdkContent failed". The stack trace of from the thrown exception is

我已经将 set $PATH 设置为我的 SDK/tools 目录(如果我只使用 Eclipse 应该没关系吧?)并启动 Eclipse,但是当我尝试在 Eclipse 中设置 SDK 的路径时,出现错误“ parseSdkContent 失败”。抛出异常的堆栈跟踪是

java.lang.IllegalArgumentException: http://www.w3.org/2001/XMLSchema
at javax.xml.validation.SchemaFactory.newInstance(SchemaFactory.java:181)
at com.android.ide.eclipse.adt.internal.sdk.LayoutDevicesXsd.getValidator(Unknown Source)
at com.android.ide.eclipse.adt.internal.sdk.LayoutDeviceManager.parseLayoutDevices(Unknown Source)
at com.android.ide.eclipse.adt.internal.sdk.LayoutDeviceManager.loadDefaultLayoutDevices(Unknown Source)
at com.android.ide.eclipse.adt.internal.sdk.LayoutDeviceManager.loadDefaultAndUserDevices(Unknown Source)
at com.android.ide.eclipse.adt.internal.sdk.Sdk.<init>(Unknown Source)
at com.android.ide.eclipse.adt.internal.sdk.Sdk.loadSdk(Unknown Source)
at com.android.ide.eclipse.adt.AdtPlugin.run(Unknown Source)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

I can't see that I've missed anything in the setup process, according to the instructions it should basically just work out of the box. Any ideas as to why this might fail?

我看不出我在设置过程中遗漏了任何东西,根据说明,它基本上应该是开箱即用的。关于为什么这可能会失败的任何想法?

采纳答案by Sebastian Ganslandt

A quick glance at http://java.sun.com/javase/6/docs/api/javax/xml/validation/SchemaFactory.htmlsuggests that something is wrong with the JDK 1.6 setup.

快速浏览一下http://java.sun.com/javase/6/docs/api/javax/xml/validation/SchemaFactory.html表明 JDK 1.6 设置有问题。

Setting the -vm flag in eclipse to the original 1.5 did not help, but after removing all traces of the apparently misconfigured 1.6 everything worked like a charm.

将 eclipse 中的 -vm 标志设置为原始 1.5 并没有帮助,但是在删除所有明显错误配置的 1.6 的痕迹后,一切都像魅力一样。

回答by Rymnel

So my solution was completely different. The project.properties was corrupted. I had to edit it from the command line as eclipse didn't want to do anything for me. I deleted everything that was unnecessary. So that the file looked like this:

所以我的解决方案完全不同。project.properties 已损坏。我不得不从命令行编辑它,因为 eclipse 不想为我做任何事情。我删除了所有不需要的东西。使文件看起来像这样:

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.

# Project target.
target=android-15

Closed Eclipse. Opened it again.

封闭的日食。又打开了。

I then went back into the project properties and reset my libraries. This solved the problem. Hope this helps someone else!

然后我回到项目属性并重置我的库。这解决了问题。希望这对其他人有帮助!

回答by Waqas

For me updating the DDMS from ADT plugin did the trick!

对我来说,从 ADT 插件更新 DDMS 就成功了!

Before that for saving time I only updated ADT plugin, nothing else like Android DDMS, TraceView etc. so I ran into same issue, after couple of restarts and Google searches everyone was proposing different solutions. I updated my Android DDMSand restarted eclipse.

在此之前,为了节省时间,我只更新了ADT 插件,没有像 Android DDMS、TraceView 等那样的东西。所以我遇到了同样的问题,经过几次重启和谷歌搜索,每个人都提出了不同的解决方案。我更新了我的Android DDMS并重新启动了 eclipse。

And It worked like a charm.

它就像一个魅力。

I didn't had to remove my workspace or update my .project file etc.

我不必删除我的工作区或更新我的 .project 文件等。

回答by Abdulqadir_WDDN

Step 1. Find the folder named: .android

步骤 1. 找到名为:.android 的文件夹

This folder can be located in your Windows user directory, for example in Windows 8: C:\Users\YOUR_WINDOWS_USERNAME.android Step 2. Delete this folder .android

此文件夹可以位于您的 Windows 用户目录中,例如在 Windows 8 中:C:\Users\YOUR_WINDOWS_USERNAME.android 步骤 2. 删除此文件夹 .android

Step 3. Restart Eclipse and it is OK now

Step 3. 重启Eclipse就OK了

回答by LeRoy

I try removeing all your projects then restart the application

我尝试删除所有项目然后重新启动应用程序

回答by 000szf

  • Installed API 19
  • Deinstalled API 20, 20L
  • 已安装的 API 19
  • 拆下的 API 20, 20L

Under Package Explorer|appcompat_v7 Android 4.4.2 didn't show up

在 Package Explorer|appcompat_v7 Android 4.4.2 下没有出现

Then removed corresponding 20-and 20L-folders in sdk/platforms and sdk/system-images

然后在 sdk/platforms 和 sdk/system-images 中删除相应的 20 和 20L 文件夹

Restart and ok

重启就好了

ADT Package 23.0.2.1259578 Eclipse Platform 4.2.2.M20130204-1200

ADT 包 23.0.2.1259578 Eclipse 平台 4.2.2.M20130204-1200

回答by kmovie

On Windows 7 with adt-bundle-windows-x86_64-20140702: removing C:\Users\YOUR_WINDOWS_USERNAME.androiddid the magic for me :)

在 Windows 7 上adt-bundle-windows-x86_64-20140702:删除 C:\Users\YOUR_WINDOWS_USERNAME.android对我来说很神奇:)