Search code examples
androidadt

Unable to run Android Virtual Device Manager "android avd" getting NullPointerException


Getting NullPointerException when trying to start avd. I just downloaded the ADT bundle for Mac and ran android avd. Anyone know why it would fail?

$ ./android avd
java.lang.NullPointerException
    at com.android.sdklib.internal.avd.AvdInfo.getDeviceName(AvdInfo.java:158)
    at com.android.sdkuilib.internal.repository.ui.DeviceManagerPage.fillDevices(DeviceManagerPage.java:497)
    at com.android.sdkuilib.internal.repository.ui.DeviceManagerPage.fillTable(DeviceManagerPage.java:357)
    at com.android.sdkuilib.internal.repository.ui.DeviceManagerPage.createContents(DeviceManagerPage.java:259)
    at com.android.sdkuilib.internal.repository.ui.DeviceManagerPage.<init>(DeviceManagerPage.java:130)
    at com.android.sdkuilib.internal.repository.ui.AvdManagerWindowImpl1.createDeviceTab(AvdManagerWindowImpl1.java:210)
    at com.android.sdkuilib.internal.repository.ui.AvdManagerWindowImpl1.createContents(AvdManagerWindowImpl1.java:193)
    at com.android.sdkuilib.internal.repository.ui.AvdManagerWindowImpl1.open(AvdManagerWindowImpl1.java:133)
    at com.android.sdkuilib.repository.AvdManagerWindow.open(AvdManagerWindow.java:94)
    at com.android.sdkmanager.Main.showAvdManagerWindow(Main.java:369)
    at com.android.sdkmanager.Main.doAction(Main.java:311)
    at com.android.sdkmanager.Main.run(Main.java:119)
    at com.android.sdkmanager.Main.main(Main.java:102)

Solution

  • I had this exact same problem last night and finally found the ways to get the emulator to start working:

    List the available targets with: android list targets

    android create avd -n {name} -t {targetID} (for {name} I chose Tablet - believe its arbitrary)

    == Still wasn't working but then I discovered =>

    I right-clicked above the manifest.xml file, selected option Run As -> Run Configurations -> on a tab Target, and selected AVD created.

    (from Eclipse launch error when trying to run an Android app)