Cannot start Android Virtual Device Manager "android avd", getting a NullPointerException

Giving a NullPointerException when trying to run avd. I just downloaded the ADT package for Mac and launched avroid. Does anyone know why this will 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) 
+6
source share
6 answers

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

List of available goals with: Android goal list goals

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

== Still not working, but then I discovered =>

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

(from Error starting Eclipse when trying to launch an Android application )

+4
source

The following worked for me:

At the command prompt, I went to the tool folder of the Android-SDK folder. From there, I ran this command:

 android list avd 

This created a list of all my virtual devices, but one of them showed that this was a problem. The exact result 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 pay attention to 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 run the AVD manager without any problems.

+13
source

I had the same problem after moving my Android SDK and changing the base directory by setting the ANDROID_SDK_HOME environment variable. Turns out there is a path inside the next file (path below ANDROID_SDK_HOME).

.android / AVD / nameofphone.ini

The path = parameter in this file is absolute, so if you move files, it will be wrong. Changing this correct absolute path to the avd file in the same directory fixed my problem.

+2
source

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

+2
source

This usually happens due to a failure to create a new AVD or corrupted configurations for one of your AVDs.

Go to ~ / .android / avd

Check out the AVD list. If you think one of these AVDs is causing problems, sudo rm -r (UNIQUE PART OF AVD NAME) *

This removes the AVD. Then try again avroid

@BreakingBad works fine unless the configuration is corrupted

+2
source

It looks like this problem has been fixed in version 21.0.1 preview 1 of the SDK tools.

http://code.google.com/p/android/issues/detail?id=40400

The most likely cause is an invalid property file that could not be analyzed using AVD Manager. An update to the SDK Tools preview channel should fix this, or you can just wait for the official release.

As soon as I updated, AVD Manager started up and showed the wrong AVD in my list, which I was able to delete.

+1
source

All Articles