15

I'm brand new to Android development and Eclipse so I have just set it all up and I am attempting the Hello World tutorial. Sadly when I try and run the program I get the following error:

PANIC: Could not open: C:\Users\Nathan Smith.android/avd/Droid_4.0.3.ini

I have heard that you should avoid spaces in these paths. Is the space in the name where the problem is? If so how do I go about changing it?

If anyone could help me out with this that would be grand.

By the way I also noticed that my SDK path is C:\Users\Asus Laptop\android-sdks\ should I change this to the same user? This was not intentional, is there an easy way of me changing this to the right user?

Nanne
  • 64,065
  • 16
  • 119
  • 163
Kingteeb
  • 243
  • 2
  • 3
  • 8
  • possible duplicate of [android emulator error](http://stackoverflow.com/questions/6936230/android-emulator-error2011-08-02-111401-emulator-panic-could-not-open-c) – Colin Pickard Jan 25 '12 at 20:47
  • Found the best solution to this problem here: http://stackoverflow.com/questions/2841766/possible-to-change-where-android-virtual-devices-are-saved – justclaire May 16 '13 at 21:17

8 Answers8

22

This has been asked a few times already, try this:

  1. Create a environment variable called: ANDROID_SDK_HOME and set it to C:\Users\Administrator
  2. Open Eclipse > Window > Preferences and click in Run/Debug and String Substitution
  3. Add a new variable called: user.home and set it to C:\Users\Administrator
  4. Create an AVD and run it.
Community
  • 1
  • 1
Colin Pickard
  • 45,724
  • 13
  • 98
  • 148
  • Thank you for the response. How exactly do I create an environment variable? Sorry to be so needy. – Kingteeb Jan 25 '12 at 20:50
  • 1
    Try these: [Environment Variables in Windows XP](http://support.microsoft.com/kb/310519), or [Environment Variables in Windows 7](http://www.windows7hacker.com/index.php/2010/05/how-to-addedit-environment-variables-in-windows-7/) – Colin Pickard Jan 25 '12 at 20:53
  • What kind of environment variable (user of system) should it be? – Alan Coromano Dec 19 '12 at 11:03
  • Hi, What is this "C:\Users\Administrator" directory? I'm having the same issues, did exactly that and it still doesn't work. – Gal Appelbaum Jan 26 '13 at 04:48
  • Great advice. Just set the values to the home folder of the logged in user(ex. c:\users\(username)). Just make sure the user account is setup as an administrator. I asume these paths are made to make sure Eclipse knows where to find the the AVD's. Just copying the AVD's to the wanted location is just a workaround. – Maya Kathrine Andersen Mar 28 '13 at 11:13
  • @ColinPickard I have followed the same procedure told by you but still the problem is not solved. Could you please help me with it. – ankit Aug 20 '13 at 09:14
  • 1
    @ankit create a new question, explain what you have tried and what errors you are seeing. You can link it to this one. – Colin Pickard Aug 20 '13 at 09:21
  • @ColinPickard thanks for the reply but currently I dont have access to ask questions any idea what can be the problem. Till yesterday it was running fine but from today morning it has started giving error. – ankit Aug 20 '13 at 09:35
  • What error? Are you clicking the ask question button or going straight to http://stackoverflow.com/questions/ask? – Colin Pickard Aug 20 '13 at 09:43
  • 1
    You have to restart eclipse after creating the new enviroment variable. – lephleg Jan 21 '14 at 15:09
10

A simple solution,

Create your avd with normal steps. e.g. avd name is Nexus_One. You will see Nexus_One folder and Nexus_One.ini file at D:\Users\Nathan Smith\.android\avd

Copy Nexus_One.ini to C:\Users\Nathan Smith\.android\avd

Try running avd through AVD Manager. It will start the emulator.

Reason being it works, if you read ini file, you will find path variable as below,

path=D:\Users\Nathan Smith\.android\avd\Nexus_One.avd path.rel=avd\Nexus_One.avd

So, when you start emulator, it check the ini and tries to start emulator from path mentioned in path variable.

Hope this solves your problem.

Swaroop
  • 532
  • 1
  • 4
  • 16
6

Find the .android folder on your cpu. You can find it by going to Window -> Preferences -> Android -> Build, and see the "Default debug keystore:" path location.

After you find it, move the .android folder to your user root directory - which may be "C:\Users\Nathan Smith\" in your case.

worked
  • 5,762
  • 5
  • 54
  • 79
1

The simple solution is to create a symbolic link between your home directory and destination .android directory. The problem is that emulator looks for files on in your home directory.

mklink /D Link Target 

Probably you can copy .android dir or change a setting.

elixenide
  • 44,308
  • 16
  • 74
  • 100
Cyva
  • 1,057
  • 10
  • 9
1

I had the same problem, but now its fixed.

Go to Windows in Eclipse, Windows->preference->run/debug->stringSubstitution-> add variable name as "user.home" Then the value will be your profile path Example: mine is C:\users\sriramk\.android

Now open the default .android path, copy the content, and paste that content into C:\users\sriramk\.android. Restart Eclipse and now the emulator will open.

elixenide
  • 44,308
  • 16
  • 74
  • 100
sriram
  • 11
  • 2
0

The AVD manager normally uses the user's profile directory to store AVD files.

However it failed to find the default profile directory.

To fix this, please set the environment variable ANDROID_SDK_HOME to a valid path such as "".

Step 1. (Windows 7 Only... 64-bit version Tested) Go to your start menu, then open the Control Panel.Click System and Security, click System, then open up the Advanced System Settings (on the left). Go to the Advanced Tab, then click Environment Variables.Check your user variables.

If you don't, find A variable named ANDROID_SDK_HOME with the Value, click new. In the Variable Name box, type in "ANDROID_SDK_HOME" (Without quotes).

In the Variable Value, type in something like c:/Users/jorge/AppData/Local/Android/Android-sdk. Click OK.Then click OK. Click OK again. Close the Control Panel and restart your computer.

Try Running SDK or AVD Manager(s) again. Create an AVD and run it.

zurfyx
  • 31,043
  • 20
  • 111
  • 145
Amr2107
  • 11
  • 1
0

Home Folder Redirection To UNC / AVD Shows UNC Path

If you're unfortunate to have network UNC path mapped as your home directory using Windows Folder Redirection then AVD will fail to start.

You should also have a normal user directory under C:\Users, which contains non-mapped stuff. The trick is for Android SDK to use this instead. Similar to other answers, you need to set ANDROID_SDK_HOME user environment variable to your C:\ based home directory.

For example:

 ANDROID_SDK_HOME = C:\Users\MyUserName

Restart Eclipse.

In my hunt for a resolution, I found this answer which gives a great performance increase: https://stackoverflow.com/a/19338671/1554386

Community
  • 1
  • 1
Alastair McCormack
  • 26,573
  • 8
  • 77
  • 100
0

I had the same problem, the issue seemed to be low disk space on the drive containing the emulator files (C).

meshanator
  • 21
  • 2
  • 4