Android SDK 内容加载器因 NullPointerException 失败
最近,每当我与 Eclipse Helios 中的 Android SDK 和 AVD Manager 交互时,我都会遇到错误。
我尝试重新安装 Eclipse 插件和 Android SDK,但无济于事。
如果我转到“已安装的软件包”页面并单击刷新(或安装或删除软件包),我会收到一个弹出框,显示以下内容
'Android SDK Content Loader' has encountered a problem.
parseSdkContent failed
java.lang.NullPointerException.
是完整日志:
堆栈跟踪
java.lang.NullPointerException
at com.android.ide.eclipse.adt.internal.sdk.Sdk.loadTarget(Unknown Source)
at com.android.ide.eclipse.adt.AdtPlugin$10.run(Unknown Source)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
会话数据
eclipse.buildId=M20100909-0800
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_IE
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.java.product
最近还有其他人遇到过此情况吗? 它似乎并没有影响实际的 Android 开发,但它只是有点烦人。
I've just recently started getting an error any time I interact with the Android SDK and AVD Manager in Eclipse Helios
I've tried reinstalling the Eclipse plugin and the Android SDK but to no avail.
If I go to the "Installed packages" page and click refresh (or install or remove a package) I get a popup box saying that
'Android SDK Content Loader' has encountered a problem.
parseSdkContent failed
java.lang.NullPointerException.
Here is the full log:
Stack Trace
java.lang.NullPointerException
at com.android.ide.eclipse.adt.internal.sdk.Sdk.loadTarget(Unknown Source)
at com.android.ide.eclipse.adt.AdtPlugin$10.run(Unknown Source)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Session Data
eclipse.buildId=M20100909-0800
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_IE
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.java.product
Has anyone else encountered this recently?
It doesn't seem to be affecting actual Android development but its just kinda annoying.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(22)
问题出在位于 Windows 计算机上
...\\.android
的your-avd-name.ini
中(如果您是 Windows 用户)。当 avd.ini 解析器期间发生任何错误时,Google ADT 插件会尝试访问空映射。解决方法是删除有问题的 .ini 文件并重新创建 avd。此信息发布在这里:http://community.developer.motorola.com/t5/MOTODEV-Studio-for-Android/Android-SDK-Content-Loader-has-encountered-a-problem/td -p/6565
The issue is in the
your-avd-name.ini
that is located at...\<user-profile>\.android
on your Windows machine (if you're Windows user). When any error occurs during the avd.ini parser, the Google ADT plugin tries to access a map that is null. The workaround is to delete the offending .ini file and recreate your avd(s).This information was posted here: http://community.developer.motorola.com/t5/MOTODEV-Studio-for-Android/Android-SDK-Content-Loader-has-encountered-a-problem/td-p/6565
我通过删除用户配置文件中的 .android 目录解决了该问题。
I solved the problem by deleting the .android directory in my user profile.
解决方案:
第 1 步。找到名为:> 的文件夹
.android
此文件夹可以位于您的 Windows 用户目录中,例如在 Windows 7/8 中:
第 2 步。删除此文件夹
.android
第 3 步。重启Eclipse,现在就OK了
Solution:
Step 1. Find the folder named: >
.android
This folder can be located in your Windows user directory, for example in Windows 7/8:
Step 2. Delete this folder
.android
Step 3. Restart Eclipse and it is OK now
我通过从工作区删除 .metadata 文件夹解决了问题
I solved the problem by deleting the .metadata folder from workspace
转到
C:/Users//.avd
并删除AVD
的.ini
文件。重新启动 Eclipse ..否则,如果您不知道要删除哪个文件或者上述解决方案对您不起作用,请删除整个创建的 AVD 文件夹..并重新启动 eclipse..
Go to
C:/Users/<profile-name>/.avd
and delete the.ini
file of theAVD
..Restart Eclipse..otherwise if you don't know what file to delete or the above solution did not work for you, delete the entire created
AVD
folder..and restart eclipse..问题出在 Windows 上 your-avd-name.ini(配置文件) 中,该文件位于 .android(搜索它)机(如果您是 Windows 用户)。当 avd.ini 解析器期间发生任何错误时,Google ADT 插件会尝试访问空映射。 解决方法是删除有问题的 .ini 文件并重新创建您的 avd。
The issue is in the your-avd-name.ini (config files) that is located at .android (search it)on your Windows machine (if you’re Windows user). When any error occurs during the avd.ini parser, the Google ADT plugin tries to access a map that is null. The workaround is to delete the offending .ini file and recreate your avd(s).
尝试从中删除 .android 文件夹
并打开 Eclipse 并遵循此 结构配置您的 SDK 以安装新的 SDK 或从已安装的 SDK
Try to delete .android folder from
and open your eclipse and follow this Structure to configure your SDK for either installing new SDK or from installed one
我相信问题出在你的 ADT 工具上。如果您运行了 eclipse 插件更新(这将更新 ADT),问题就会解决。
I believe the trouble was with your ADT tools. If you had run eclipse plugin updates (which would update ADT), problem would have solved.
有时,当我为虚拟设备选择不正确的值时,如果该不正确的值导致 AVD 启动时出现蓝屏死机,我有时会遇到
parseSdkContent failed
问题:在计算机重新启动时崩溃后,出现“parseSdkContent failed” ” 启动 Eclipse 时会出现错误。这会给你带来各种各样的错误,而这些错误根本不会给你任何关于问题的线索,从所有的错误中你可能会想重新安装 Eclipse 甚至 Java,但不要这样做,它可能会简单得多。
对我来说,解决方案非常简单:删除 .avd 文件夹和 ..Users\.android 文件夹中的 .ini 文件。
因此,备份 AVD 是个好主意,因为如果崩溃,它就会损坏在发布期间与 Besod 一起。
I get this
parseSdkContent failed
problem sometimes when I select improper values for a virtual device, if that improper value results in a blue screen of death upon AVD launch: After the crash when the computer restarts the "parseSdkContent failed" error will come when starting Eclipse.This will give you all sorts of errors that does NOT at all give you any clue to the problem, from all the errors you may be tempted to reinstall Eclipse or even Java, but dont do that, it could be much simpler.
The solution for me is pretty simple: delete your .avd folder and the .ini file in ..Users\.android folder.
Backing up your AVD is therefore a good idea since it becomes corrupted if it crashes with Besod during launch.
好吧,我不知道我到底做了什么,但我使用了独立的 AVD 管理器(来自命令行的 /tools/android),并卸载了除“Android SDK Tools,修订版 2”之外的大部分内容。
然后重新安装我想要的部件,错误似乎消失了。
使困惑!
Ok I've no idea exactly what I did but I used the standalone AVD manager (/tools/android from the command line) and un-installed most apart from the "Android SDK Tools, revision 2".
And then reinstalled the parts I wanted and the error seems to have gone away..
Confused!
由于某些原因,我的 sdk/addons 和 sdk/platforms 目录已损坏且无法读取(计算机崩溃),这导致我的“'Android SDK Content Loader'遇到了问题”。错误。
必须删除/重命名整个 sdk 文件夹,再次下载并安装 sdk+packages。在 user/.android 中一切都很好。
For some reasons my sdk/addons and sdk/platforms directories got corrupted and unreadable (computer crash), this caused my "'Android SDK Content Loader' has encountered a problem." error.
Had to delete/rename the entire sdk folder, download and install the sdk+packages again. In user/.android everything was fine.
对我来说,
NullPointerException
问题的根源是引用(和测试)Android 项目代码的主机端 Junit 测试项目。它没有project.properties
文件。它不是 Android 项目,但由于某种原因,较新版本的 SDK 不知何故需要该文件。为了解决这个问题,我只是将一个project.properties
文件从 Android 项目复制到主机单元测试项目。For me, the source of the
NullPointerException
problem was a host-side Junit test project that references (and tests) code from an Android project. It didn't have aproject.properties
file. It's not an Android project, but for some reason the newer versions of the SDK somehow expects the file there. To fix the problem, I just copied aproject.properties
file from an Android project to the host unit test project.在执行上述步骤后,首先从命令行启动模拟器,
在我的情况下,Eclipse 启动正常。
更新:
除了重新开始之外,没有完美的解决方案来解决这个问题。 问题仍然悬而未决。
First start the emulator from command line
after doing above step in my case eclipse started fine.
UPDATE:
There is no perfect solution to this problem other than starting all over again. The issue is still open.
我的解决方案只是去帮助->寻找更新->并安装所有与 Android 相关的更新。完成后,我重新启动 Eclipse,它告诉我需要启动 SDK 管理器来更新一些东西,我单击了它显示的“打开 SDK 管理器”按钮,更新了开发工具、平台工具,添加了一些最新的 API 和 viola,一切都很好:)
My solution was simply to go to help->look for updates-> and install all android related updates. Once done, I restarted Eclipse, it told me I need to start the SDK Manager to update some stuff, I clicked the "Open SDK Manager" button it shows me, updated the dev tools, platform tools, added some latest APIs and viola, all is fine :)
只需尝试删除 .android 文件夹中的 avd 文件夹,该文件夹的路径中也可能有您的 sdk 文件夹。只需删除 avd 文件夹并尝试在 eclipse > 中配置 sdk 的路径即可偏好>安卓。然后尝试在 Eclipse 中配置新的 avd,方法是单击 avd 管理器,然后添加一个具有新名称的新 avd,然后单击开始。
您的新 avd 设备即将推出。
干杯
普拉卡什
just try to delete the avd folder inside the .android folder, which may also have ur sdk folder in the path. Just delete the avd folder and try to configure ur path of the sdk in the eclipse > preference > android. then try to configure ur new avd in the eclipse by clicking the avd manager and then adding a new avd with a new name and click the start.
Ur new avd device will launch.
Cheers
Prakash
我已经删除了 Windows 用户的 .android。
如果 adb 正在运行,请通过 adb Kill-server 停止它,然后删除该文件夹。
这对我有用,我在 Windows 7 上使用 adt-bundle-windows-x86。
问题出在 AVD 上。 AVD 保存在 .android 文件夹下,因此在新安装 adt-bundle-windows-x86 后,我们还需要删除该文件夹。
I have deleted the .android for windows user.
if adb running stop it by adb kill-server and then delete the folder.
this worked for me I am using adt-bundle-windows-x86 on window 7.
the issue is with AVD. AVD are saved under .android folder so after new installation of adt-bundle-windows-x86 we need to delete this folder also.
我使用的是 Windows 7;我在首次启动 ADT 提供的 Eclipse 时遇到此错误。我的特定变体引用了无法写入我的 C: 驱动器上的位置。我使用上面的 .metadata 技巧解决了这个问题;然后我选择“以管理员身份运行”,此后一切正常。
I'm on Windows 7; I got this error on first startup of ADT-provided Eclipse. My particular variant referenced an inability to write to a location on my C: drive. I solved it using the .metadata trick from above; then I chose "Run as Administrator" and everything worked fine after that.
我通过删除“C:\Users\EAST.android\avd”中新创建的 AVD(Android 虚拟设备)解决了问题,其中 \EAST 是我的用户名,在 avd 文件夹中,您将找到每个设备的两个文件夹,例如 myDevice .avd 和 myDevice.ini 删除这两个文件并再次运行 eclipse
i have solved the problem by deleting the newly created AVD(Android Virtual Device) in "C:\Users\EAST.android\avd" where \EAST is my user name, in avd folder you will find two folders for each device e.g. myDevice.avd and myDevice.ini delete both the files and run you eclipse again
通过删除元数据和 .Android 解决了这个问题
在工作区中
Solved this by deleting metadata and .Android
in workspace
将以下行添加到 .bashrc 文件中。
将“~/android-sdk-linux”替换为保存 sdk 文件夹的路径。
Add following lines to .bashrc file.
replace "~/android-sdk-linux" with path where you have saved the sdk folder.
这是一种解决方法(不完全是解决方案)。在窗口>中首选项>安卓> Lint 错误检查,取消选中“保存文件时检查错误”。
我相信这可能对你有用。
This is a workaround (not exactly the solution). In Window > Preferences > Android > Lint Error Checking, uncheck "When saving files check for errors".
I am sure this might work for you .
有类似的问题。一天又一天,我无法启动我的(到目前为止)运行良好的应用程序。会弹出“SDK Content Loader”和“NullPointerException”错误。
阅读此处的答案,但不想删除我的 .android 或 .metadata。
我尝试清理我的项目,并且 - tadaa - 它起作用了。
所以,在你开始删除插件和东西之前。尝试清理或重新启动并清理。
也许这已经可以解决您的问题。 ;)
Had a similar problem. From one day to another I wasn't able to start my (so far) well working App. "SDK Content Loader" and "NullPointerException" Errors would pop up.
Read the Answers here but didn't want to delete my .android or .metadata.
I tried to clean my Project and - tadaa - it worked.
So, before you start deleting your plugins and stuff. Try a clean or restart and clean.
Maybe this will already fix your issue. ;)