AVD - PANIC: Could not open... - not a path issue

94,614

Solution 1

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

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 answer by Colin

an android project member says here:

As a work-around, you can define the environment variable ANDROID_SDK_HOME to point to the directory containing your .android directory. The emulator and SDK Manager will pick it up properly.

Solution 2

verify that The location in which the avd was searched from is different from where it is actually created. Take a look at the screenshot below for more information.

Android Virtual Devices Manager - location of virtual devices

Solution 3

I fixed the AVD Panic issue by running Eclipse as an administrator.

Solution 4

ANOTHER OPTION: Symlinking...

In a command prompt (with admin privileges), change directory ("cd") to "C:\Users\YourUserName.android" and then use the following command to create a symlink to the avd directory (notice the direction of the slashes):

mklink /D avd D:\_MyLibrariesDir\.android\avd

Where "_MyLibrariesDir" is the directory that your libraries (photos, documents, etc) folders are located.

And you're done!


Explanation: This has the same effect as the ANDROID_SDK_HOME option except that you can now browse to [C:\Users\YourUserName\.android\avd\*] and [D:_MyLibrariesDir\.android\avd\*] and both will take you to the same spot.

This differs from a shortcut in that shortcuts do not act as directories, so if you just had a shortcut to the "avd" folder, you could not go to "C:\Users\YourUserName\.android\avd*" as it would produce a file not found error and if you tried to click on an avd shortcut file it would take you to [D:_MyLibrariesDir\.android\avd\*] instead of keeping you on the C drive. Symlinks act a bridge between locations in a way that is transparent to user and software. Quite handy :)

Solution 5

On Ubuntu check the current user if you run eclipse as root (sudo) eclipse could NOT find the /root/.android set the user home

user.home /home/<user>/

and copy the AVD files into the new directory than changes the privileges

cd /home/<user>/
chgrp <user> -R .android
chgrp <user> -R .android
Share:
94,614
NigelT
Author by

NigelT

Updated on April 22, 2020

Comments

  • NigelT
    NigelT about 4 years

    I want to write an Android app and I've started this morning by loading JDK, eclipse, SDK etc, all from the adt-bundle-windows-x86_64-20130219 from http://developer.android.com.

    The issue for me right now:

    [2013-02-27 13:36:26 - Test2] Android Launch!
    [2013-02-27 13:36:26 - Test2] adb is running normally.
    [2013-02-27 13:36:26 - Test2] Performing com.example.test2.MainActivity activity launch
    [2013-02-27 13:37:27 - Test2] Launching a new emulator with Virtual Device 'droidX2'
    [2013-02-27 13:37:27 - Emulator] PANIC: Could not open: droidX2

    I've been sifting though posts on the web all morning about AVD and I haven't seen one that didn't involve the path being messed up and the .ini not found. I don't think I've got a path issue. AVD is looking for files on D:\USERS\XXX\.android\avd and that's where the files are. So don't understand why the emulator can't open.

    I've done the most basic things like remove and re-install everything, read the notes at orace etc. Basically I'm stuck. Any suggestions here?

    adt-bundle-windows-x86_64-20130219 was what I loaded on Windows 7 (32bit).

    I'd settle for testing on the mobile that's connected to the PC but I can't get that to work either!

    Any direction appreciated.

  • NigelT
    NigelT about 11 years
    Hey there. Thanks for your reply. Yes, I had check those posts previously and have just looked at this again to be thourough. No change.
  • NigelT
    NigelT about 11 years
    Unfortunately no. No change. Is there any log or info that will tell me more about why it "Could not open"?
  • NigelT
    NigelT about 11 years
    Solved. I set the environment variable to ANDROID_SDK_HOME to point to the directory containing your .android directory. I never tried this. Thanks.
  • Raven Dreamer
    Raven Dreamer about 11 years
    I set it as a System Environmental Variable and it worked. DUnno if a user variable would work also.
  • lambsubstitute
    lambsubstitute almost 11 years
    Good tip, don't forget to restart Eclipse after changing the environment variables. I didn't and couldn't work out why the changes were not working until I did and they magically started to work.
  • Nezam
    Nezam over 10 years
    May be he was trying to point out that it should be the same.lol
  • Smiley Barry
    Smiley Barry over 10 years
    It's best to use Junctions instead of directory symlinks since Junctions are invisible to applications, unless they specifically ask to see them (OPEN_REPARSE_POINT given as an argument when looking for/opening files).
  • Tom Anderson
    Tom Anderson over 10 years
    I note that running Eclipse as an admin allows you to start the emulator without the AVD Panic issue. Not sure about the English language part...
  • Mohammed Subhi Sheikh Quroush
    Mohammed Subhi Sheikh Quroush over 10 years
    if the user name is non English , this will cause the problem
  • mahela007
    mahela007 over 10 years
    Using the string substitution menu in Eclipse didn't work for me for some reason. However, creating a symlink solved the problem. I think the problem was caused by my having a separate partition for my data folders (such as my documents, my pictures etc)
  • user2548816
    user2548816 almost 10 years
    hey guys i just posted the corrected location,, it was actually different and i posted the screen shot after i fixed the issue,, but however ones having the problem can cross check if the paths highlighted are same or not.
  • user2548816
    user2548816 over 9 years
    it some times looks for the avd in that location but some times the avd is not there ,, and get created in some other folder and hence we have the error.. so place the avd in specified folder and it would be fine
  • Apperside
    Apperside over 9 years
    it worked for me but I had to restart windows. thanks!
  • Hugo Delsing
    Hugo Delsing about 8 years
    Solved it for Visual Studio/xamarin
  • Dominic
    Dominic over 7 years
    Using a non-English Windows, this worked for me only after setting the ANDROID_SDK_HOME to the "Users" folder in my own language (C:\Benutzer\...) even though both C:\Users\... and C:\Benutzer\... are working in the explorer.