36

I'm just starting to use Eclipse and ADT and I have some issues, the Android Emulator don't start :

[2011-07-10 15:32:25 - Android_FirstApp] ------------------------------
[2011-07-10 15:32:25 - Android_FirstApp] Android Launch!
[2011-07-10 15:32:25 - Android_FirstApp] adb is running normally.
[2011-07-10 15:32:25 - Android_FirstApp] Performing samr1.Android_FirstApp.Android_FirstAppActivity activity launch
[2011-07-10 15:32:25 - Android_FirstApp] Automatic Target Mode: launching new emulator with compatible AVD 'Android2.1'
[2011-07-10 15:32:25 - Android_FirstApp] Launching a new emulator with Virtual Device 'Android2.1'
[2011-07-10 15:32:26 - Emulator] PANIC: Could not open: C:\Users\Sam\.android/avd/Android2.1.ini

The path isn't correct, though the path in Android2.1.ini is correct. The User folder is located in an another disk.

How can I modify the start path of Android Emulator ? I can't find where.

Thanks


EDIT : I found that graphical AVD Manager creates AVD directory inside C:\Users\.android\ on Windows 7 : Default location of AVD files

But using Command Line doesn't work. So i moved my AVD files in C:\Users\Sam\ and now it works.

SamR1
  • 361
  • 1
  • 3
  • 5

6 Answers6

65

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.

Daniel S. Fowler
  • 1,982
  • 15
  • 12
  • 5
    Thanks, this worked for me. One tip: If you need to remove this directory junction link, don't use del on the "C:\Users\John Doe\.android" file. Instead, use rmdir. Rmdir will remove the link, but using del will dereference the link and try to delete all the files in "D:\John Doe\.android". – Jabavu Adams Feb 11 '12 at 19:07
  • 1
    Great solution! Although the target directory `D:\John Doe` would not be 100% correct... but I believe most readers will know you meant "whatever directory you moved your documents to". – WSBT Mar 28 '12 at 03:43
  • If this isn't working for you, simply double-click the symbolic link with your mouse through explorer. I had it linked to the wrong place. I also had to run cmd.exe as Administrator to get it working properly. –  May 08 '12 at 19:57
27
  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.

It should work now.

David Aleu
  • 3,922
  • 3
  • 27
  • 48
  • 5
    This is the correct answer. The AVD manager, not the ADT Plugin, simply needs to be told where to put the virtual devices. (Steps 2 and 3 not needed.) Symbolic links are too messy if you can just make it work as simply as this. – jnm2 Dec 16 '11 at 12:18
  • The problem with this approach is that the OP doesn't want to save any user data on the C: drive. I have the same kind of setup, where my boot drive is an SSD, and all my user data should be on the non-SSD E: drive. – Jabavu Adams Feb 11 '12 at 19:06
  • 3
    Replace the paths with the ones for you required location. – David Aleu Feb 13 '12 at 10:09
  • yep, I setup a folder called c:\android_working_folder and pointed the environment variable ANDROID_SDK_HOME to it and this works now. Thanks David, this is the best answer. – TheDavil Nov 13 '12 at 08:49
  • @David, thank you! To me, this is THE solution. I am puzzled by it not getting the most votes. – Hong Dec 02 '12 at 13:09
4

The configuration files for your emulator might have been saved by AndroidSDK and AVD Manager some where else in your hard drive.

Do the following:

  • First search for the .android folder on you harddisk.
  • After you find that, move the .android folder to your user root directory - which may be "C:\Users\hallo\" in your case.

These type of project creation errors(with cause and solution) is described here.

gtiwari333
  • 24,554
  • 15
  • 75
  • 102
1

The configuration files for your emulator might have been saved by AndroidSDK and AVD Manager some where else in your hard drive.

Do the following:

First search for the .android folder on you harddisk. After you find that, move the .android folder to your user root directory - which may be "C:\Users\something\" in your case.

Other Method

Check the location of old folder you can open eclipse Navigate to Windows--> Preferences-->Android-->Expand it and Select Build Find the Value of Default Debug keystore and you will know your .android folder location.

Then mklink /J "old folder location" "C:\Users\Something\"

PravinDodia
  • 3,271
  • 1
  • 18
  • 22
1

if anyone is interested on the same problem in Linux (Ubuntu 11.10) the solution is NOT run Android SDK Manager as root. Aparently, SDK expects to be runned by a regular user, and it tries to work with the main user folder, that's why the error. This is what I suspect.

Solarin
  • 31
  • 2
  • 5
0

This worked for me by running eclipse as root ( in Ubuntu ), my be run as administrator will work

MSaudi
  • 4,442
  • 2
  • 40
  • 65