Friday, May 27, 2011

Android Emulator Error unknown virtual device name

Couple of days back I got a windows system where I was required to do some changes for a Android app. So I started by downloading Android SDK and required packages. I created a AVD using SDK Manager. When I tried to start the AVD I got an error emulator: ERROR: unknown virtual device name. Below is the snapshot for the same.


At that time I googled a bit and found the solution by reading couple of articles. Today again one of my colleagues faced the same issue and I was scratching my head to find out what was the solution. Again wasted around 30mins to find the solution. Finally it got working, but 30mins gone wasted on a problem for which I already searched and found solution in past. So just to avoid any such instance, as a note-to-myself, in this article I'll document the exact steps required to fix this issue

Reason for this issue is Android SDK Manager (by default) expects the AVDs to be in C:\Documents and Settings\<win_user>\.android (in case of win xp) directory when AVD is started. But when AVDs are created (by default) SDK Manager creates it under C:\WINNT\.android directory. Here <win_user> is the name of the user using which you have logged in to Windows PC.

To resolve this, one of the solutions is to create a symbolic link to C:\WINNT\.android directory. To do so, follow below mentioned steps

  1. Download Sysinternal's Junction utility.
  2. Create a symbolic link using below command
    junction "C:\Documents and Settings\<win_user>\.android" C:\WINNT\.android
  3. Try starting your AVD now. It should start
  4. Done

Cheers !!!
- Jay

2 comments :

  1. I like your blog technique.This is one of the valuable post.thanks for share with us.Good post.
    Android app developers

    ReplyDelete

 
Disclaimer : This is a personal blog and all content represent what I think and it does not advocate/support/advertise any other person/company. I do not earn money or intended to do so with this blog or any of the contents the blog hosts (except the google ads which you see). If I post something here that you find helpful, that's wonderful. Just in case, if I say something stupid, the stupidity is mine, and mine alone and I can not be held for anything if you fall for such stupidity :-). I cannot be held responsible for any kind of damage that may be caused by downloading or viewing the files or information provided herewith. Anybody and everybody can use/refer the contents of this blog at their own will and of course at own risk. There is no need for any kind of approval of the author. Although it would be great if feedback is left for any such usage to the author.