Android ADT Eclipse 插件,parseSDKContent 失败
我刚刚设置了我的第一个 Android 开发环境,其中包括
- Eclipse 3.5
- Mac OSX 10.5
- Android SDK for x86 macs
- ADT Eclipse 插件 0.9.6
我已将 set $PATH 设置为我的 SDK/tools 目录(如果我只使用 Eclipse 对吗?)并启动 Eclipse,但是当我尝试在 Eclipse 中设置 SDK 的路径时,出现错误“parseSdkContent failed”。抛出异常的堆栈跟踪是
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$13.run(Unknown Source)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
我看不到我在设置过程中错过了任何内容,根据说明它基本上应该开箱即用。关于为什么这可能失败的任何想法?
I've just set up my first Android development environment consisting of
- Eclipse 3.5
- Mac OSX 10.5
- Android SDK for x86 macs
- ADT Eclipse plugin 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
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$13.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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
在使用
adt-bundle-windows-x86_64-20140702
的 Windows 7 上:去除
C:\Users\YOUR_WINDOWS_USERNAME.android
为我创造了魔法:)
On Windows 7 with
adt-bundle-windows-x86_64-20140702
:removing
C:\Users\YOUR_WINDOWS_USERNAME.android
did the magic for me :)
未显示
然后删除 sdk/platforms 和 sdk/system-images 中相应的 20 和 20L 文件夹
重新启动并确定
ADT Package 23.0.2.1259578
Eclipse 平台 4.2.2.M20130204-1200
Under Package Explorer|appcompat_v7 Android 4.4.2 didn't show up
Then removed corresponding 20-and 20L-folders in sdk/platforms and sdk/system-images
Restart and ok
ADT Package 23.0.2.1259578
Eclipse Platform 4.2.2.M20130204-1200
我尝试删除您的所有项目,然后重新启动应用程序
I try removeing all your projects then restart the application
快速浏览一下 http://java.lang. sun.com/javase/6/docs/api/javax/xml/validation/SchemaFactory.html 表明 JDK 1.6 设置有问题。
将 eclipse 中的 -vm 标志设置为原始 1.5 并没有帮助,但在删除明显错误配置的 1.6 的所有痕迹后,一切都像魅力一样工作。
A quick glance at http://java.sun.com/javase/6/docs/api/javax/xml/validation/SchemaFactory.html suggests that something is wrong with the JDK 1.6 setup.
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.
步骤 1. 找到名为:.android 的文件夹
该文件夹可以位于您的 Windows 用户目录中,例如在 Windows 8 中:
C:\Users\YOUR_WINDOWS_USERNAME.android
步骤2.删除这个文件夹.android
步骤3.重新启动Eclipse,现在就OK了
Step 1. Find the folder named: .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
Step 3. Restart Eclipse and it is OK now
对我来说,从 ADT 插件更新 DDMS 就成功了!
在此之前,为了节省时间,我只更新了ADT插件,没有像Android DDMS、TraceView等那样更新,所以我遇到了同样的问题,经过几次重新启动和Google搜索后,每个人都提出了不同的解决方案。我更新了我的 Android DDMS 并重新启动了 eclipse。
它的作用就像一个魅力。
我不必删除我的工作区或更新我的 .project 文件等。
For me updating the DDMS from ADT plugin did the trick!
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 DDMS and restarted eclipse.
And It worked like a charm.
I didn't had to remove my workspace or update my .project file etc.
所以我的解决方案完全不同。该project.properties已损坏。我必须从命令行编辑它,因为 Eclipse 不想为我做任何事情。我删除了所有不需要的东西。这样文件看起来像这样:
Closed Eclipse.再次打开它。
然后我返回项目属性并重置我的库。这解决了问题。希望这对其他人有帮助!
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:
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!