简体   繁体   English

在Mac OS X上安装Android SDK时发生NullPointerException

[英]NullPointerException when installing the Android SDK on Mac OS X

I'm installing the Android SDK on Mac OS X. Following the instructions on the Android Development site, I've downloaded the SDK and modified my .bash_profile to include the path. 我正在Mac OS X上安装Android SDK。按照Android开发网站上的说明,我已经下载了SDK,并修改了.bash_profile使其包含路径。 The next step is to use the Android SDK and AVD Manager to actually download the platforms. 下一步是使用Android SDK和AVD Manager实际下载平台。

However, when I use the Manager to install the platforms, I get the following error in the Terminal. 但是,当我使用Manager安装平台时,在终端中出现以下错误。 I've looked around for similar problems in the Eclipse and Android forums and haven't found anything yet. 我在Eclipse和Android论坛中到处寻找类似的问题,但尚未发现任何东西。 Is something else damaged in the environment and needs to be repaired? 环境中还有其他损坏的地方,需要修理吗? Any recommendations on where I should look? 关于我应该看什么的任何建议?

EDIT: I'm on Java version 1.6-u17. 编辑:我在Java版本1.6-u17上。 Just updated OS X to 10.6.3. 刚刚将OS X更新为10.6.3。

java.lang.NullPointerException
at org.eclipse.swt.graphics.Device.getFontList(Unknown Source)
at org.eclipse.jface.resource.FontRegistry.filterData(FontRegistry.java:456)
at org.eclipse.jface.resource.FontRegistry.createFont(FontRegistry.java:490)
at org.eclipse.jface.resource.FontRegistry.defaultFontRecord(FontRegistry.java:551)
at org.eclipse.jface.resource.FontRegistry.defaultFontData(FontRegistry.java:563)
at org.eclipse.jface.resource.FontRegistry.getFontData(FontRegistry.java:579)
at org.eclipse.jface.dialogs.Dialog.dialogFontIsDefault(Dialog.java:1077)
at org.eclipse.jface.dialogs.Dialog.applyDialogFont(Dialog.java:998)
at org.eclipse.jface.dialogs.Dialog.createContents(Dialog.java:756)
at org.eclipse.jface.window.Window.create(Window.java:431)
at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
at com.android.sdkuilib.internal.repository.UpdateChooserDialog.create(UpdateChooserDialog.java:280)
at org.eclipse.jface.window.Window.open(Window.java:790)
at com.android.sdkuilib.internal.repository.UpdaterData.updateOrInstallAll(UpdaterData.java:502)
at com.android.sdkuilib.internal.repository.RemotePackagesPage.onInstallSelectedArchives(RemotePackagesPage.java:323)
at com.android.sdkuilib.internal.repository.RemotePackagesPage.access$600(RemotePackagesPage.java:54)
at com.android.sdkuilib.internal.repository.RemotePackagesPage$7.widgetSelected(RemotePackagesPage.java:168)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.notifyListeners(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at com.android.sdkuilib.internal.repository.UpdaterWindowImpl.open(UpdaterWindowImpl.java:104)
at com.android.sdkuilib.repository.UpdaterWindow.open(UpdaterWindow.java:110)
at com.android.sdkmanager.Main.showMainWindow(Main.java:281)
at com.android.sdkmanager.Main.doAction(Main.java:247)
at com.android.sdkmanager.Main.run(Main.java:92)
at com.android.sdkmanager.Main.main(Main.java:81)
logout

I discovered that there is a problem after updating to 10.6.3 (should have known). 我发现更新到10.6.3后应该有一个问题(应该知道)。 I wasn't able to find anything about it, but after posting this, I suddenly couldn't open Eclipse either. 我什么都找不到,但是发布之后,我突然也无法打开Eclipse。 That led to this thread on the Apple forums indicating that the problem could be a corrupt font cache, which in turn led to an explanation of how to clear the font cache here . 这导致在Apple论坛上出现该线程 ,表明问题可能是字体缓存损坏,进而导致在此处解释如何清除字体缓存。 After following the instructions for clearing the font cache, I tried both Eclipse and the Android install again; 按照清除字体缓存的说明进行操作之后,我再次尝试了Eclipse和Android安装; this time it worked perfectly. 这次,它运行良好。

What version of OS X are you on? 您正在使用什么版本的OS X? What does "java -version" give you? “ java -version”给您什么?

A possible easy workaround: Try installing the SDKs you need from inside Eclipse after installing the ADT plugin using Window -> Android SDK and AVD Manager, instead of the standalone frontend tool. 一种可能的简单解决方法:在使用Window-> Android SDK和AVD Manager而不是独立的前端工具安装ADT插件之后,尝试从Eclipse内部安装所需的SDK。 Since that runs inside Eclipse, there tends to be fewer weird library compatibility issues. 由于该程序在Eclipse中运行,因此趋向于减少怪异的库兼容性问题。

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

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