Android AVD Manager:无法创建新的设备定义(java.lang.NullPointerException)

时间:2014-07-08 03:02:51

标签: java android android-emulator

我在Mac OS X 10.9.3上运行最新版本的Android SDK。我以前没有在这台机器上安装Android SDK或任何其他Java开发环境,所以这可以被视为全新安装。

尝试使用AVD Manager创建新设备定义时没有任何反应,但以下终端输出除外:

java.lang.NullPointerException
    at com.android.sdkuilib.internal.widgets.DeviceCreationDialog.okPressed(DeviceCreationDialog.java:916)
    at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:472)
    at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
    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 org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
    at org.eclipse.jface.window.Window.open(Window.java:801)
    at com.android.sdkuilib.internal.repository.ui.DeviceManagerPage.onNewDevice(DeviceManagerPage.java:658)
    at com.android.sdkuilib.internal.repository.ui.DeviceManagerPage.access$100(DeviceManagerPage.java:97)
    at com.android.sdkuilib.internal.repository.ui.DeviceManagerPage$3.widgetSelected(DeviceManagerPage.java:215)
    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.ui.AvdManagerWindowImpl1.open(AvdManagerWindowImpl1.java:146)
    at com.android.sdkuilib.repository.AvdManagerWindow.open(AvdManagerWindow.java:94)
    at com.android.sdkmanager.Main.showAvdManagerWindow(Main.java:437)
    at com.android.sdkmanager.Main.doAction(Main.java:379)
    at com.android.sdkmanager.Main.run(Main.java:150)
    at com.android.sdkmanager.Main.main(Main.java:116)

以下是该窗口的屏幕截图:

The mentioned AVD Manager window

我尝试使用android avdandroid sdk同时运行AVD Manager并获得相同的结果。我能够基于通用设备定义创建一个新的AVD,就是这样。

我身边有什么问题,或者我遇到某种错误?

4 个答案:

答案 0 :(得分:18)

我在Ubuntu 14.04上遇到了同样的问题。到目前为止没有找到任何干净的解决方案,但作为解决方法尝试克隆现有设备,然后根据需要编辑其属性。

答案 1 :(得分:4)

这似乎是框架中的一个错误,因为我使用Eclipse Juno& ADT 23.0.2。错误报告如下。

https://code.google.com/p/android/issues/detail?id=73280

答案 2 :(得分:3)

这是一个错误。可能的解决方法是克隆现有设备定义(例如Nexus 7)并将其设置为所需参数。

答案 3 :(得分:2)

试试这个(考虑原因是现有AVD的配置已损坏):

转到〜/ .android / avd

检查AVD列表。如果你认为其中一个AVD导致问题,sudo rm -r(AVD NAME NAME)*

这删除了AVD。然后重新尝试android avd