16

I'm new to android app dev. When I created a new AVD, when I click start on this AVD: I get the following:

Starting emulator for AVD 'Nexus_4_16_AVD'
PANIC: Could not open: Nexus_4_16_AVD

jerryh91
  • 1,777
  • 10
  • 46
  • 77

4 Answers4

30

This is a bug in the ADT Plugin. For a workaround until it is fixed use a NTFS symbolic link.

I have a C: drive for windows 7 and a D: drive for all my work and data. After installing windows 7 I relocate all my special folders from C:\Users\John Doe to D:\John Doe. The ADT Plugin is trying to load the emulator from C: when it and the configure files are on D: (PANIC: Could not open etc.). NTFS can get the ADT Plugin to read from D: using a NTFS symbolic link. Open a command prompt in C:\Users\John Doe (obviously use your user name), use the mklink command.

 mklink /J "C:\Users\John Doe\\.android" "D:\John Doe\\.android"

Now when the ADT plugin is trying to reference .android on C:, NTFS sends the request to D: and the emulator starts correctly.

Original Source

OR

If it is not a path issue, then:

Create a environment variable called: ANDROID_SDK_HOME and set it to C:\Users\Administrator Open Eclipse > Window > Preferences and click in Run/Debug and String Substitution Add a new variable called: user.home and set it to C:\Users\Administrator Create an AVD and run it.

Original Source

Community
  • 1
  • 1
Umer Farooq
  • 7,356
  • 7
  • 42
  • 67
  • I tried your latter solution. I can't even create a AVD now, with the ERROR: [2013-08-30 18:33:29 - SDK Manager] Error: null – jerryh91 Aug 30 '13 at 23:31
  • I'll try your former soln. What's so special about the D drive? How do you know that's where the emulator and config files are? When I looked at my Path listed in AVD details, it seems to point to the appropriate folder, containing "config.ini" and "userdata.img" – jerryh91 Aug 30 '13 at 23:47
  • mklink worked for me as trying to move/replace the emulator manager would always try to re-write to the wrong folder – ScottN Dec 11 '13 at 19:01
11

Simply if nothing works for you, just copy the .android folder to C:\Users\.android.

Surya
  • 439
  • 3
  • 9
  • 31
  • 1
    I did not ask this question but found this thread as I had the same problem! – Mokkapps Dec 11 '13 at 09:46
  • Worked for me too. +1 I guess everytime I create a new avd I have to update my C:\ folder since it gets created in the D:\ – RED_ Dec 12 '13 at 17:20
  • @Surya How do I do this on XP? – Volatil3 Apr 12 '14 at 15:47
  • @Volatil3 copy the .android folder to C:\Users\YourName\.android or to C:\Users\.android – Surya Apr 18 '14 at 11:52
  • thanks this works :D i tried to create a mklink but it was already there, the difference was that .android folder in my c drive was having different content that the one in d drive, so copying content helped – S4beR Oct 01 '14 at 10:27
3

I had the same issue, and the first Umer Farooq's suggestion solved it. There was already the folder .android in C:/Users/MyName folder. I compressed it to the .android.zip for the backup purpose, and then deleted the folder C:/Users/MyName/.android. Then I opened a command prompt (it was already located at C:/Users/MyName) and executed a command:

 mklink /J "C:\Users\MyName\\.android" "D:\\.android"

Then I restarted eclipse and launched the AVD. The virtual device has been created and it worked well.

  • your solution works, what surprises me is that the bug is not fixed yet (nov 2014) –  Dec 03 '14 at 11:32
1

my avd was in folder d:\c_data.android. it was searching in folder c:\users\rkk.android. i copied avd folder from d:\ and pasted in c:\users\rkk.android. And it was success.