Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

android

adt

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)
like image 645
Vineet Bhatia Avatar asked Nov 15 '12 00:11

Vineet Bhatia


3 Answers

The following worked for me:

From the command line I navigated to the tools folder of the Android-SDK folder. From there I ran this command:

android list avd

This produced a list of all of my virtual devices but one of them showed itself to be the problem. The exact output was as follows:

The following Android Virtual Devices could not be loaded:
   Name: Tab31
   Path: /Users/User/.android/avd/Tab31.avd
   Error: Failed to parse properties from /Users/User/.android/avd/Tab31.avd/config.iniere

If you see this then make note of the "Name" property ("Tab31" in my situation) and run the following command (obviously replacing the name of my AVD with yours):

android delete avd -n Tab31

After that I was able to start the AVD Manager without any problem.

like image 140
BreakingBrad Avatar answered Nov 15 '22 06:11

BreakingBrad


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)

like image 45
vrwired Avatar answered Nov 15 '22 07:11

vrwired


If nothing of the above solutions work, deleting the .android folder in the home directory will work

like image 21
MSIslam Avatar answered Nov 15 '22 08:11

MSIslam