18

I am beginner android application developer. I have done lot of apps in eclipse on emulator and device also. But now it is giving error at the time of running project on emulator. It is working on device phone but on emulator it is giving following error:

[2011-08-02 11:14:00 - hello1] ------------------------------

[2011-08-02 11:14:00 - hello1] Android Launch!

[2011-08-02 11:14:00 - hello1] adb is running normally.

[2011-08-02 11:14:00 - hello1] Performing com.mahiways.Hello1.Hello1Activity activity launch

[2011-08-02 11:14:00 - hello1] Automatic Target Mode: launching new emulator with compatible AVD 'myemu'

[2011-08-02 11:14:00 - hello1] Launching a new emulator with Virtual Device 'myemu'

[2011-08-02 11:14:01 - Emulator] PANIC: Could not open: C:\Users\hallo\.android/avd/myemu.ini

How can I solve this problem?

Rob Hruska
  • 118,520
  • 32
  • 167
  • 192
yamini
  • 181
  • 1
  • 1
  • 3
  • the adb cant able to find emulator.avd. so first delete avd from avdManage and create a new. – Nikunj Patel Aug 04 '11 at 04:40
  • plz check the path C:\Users\hallo.android/avd/myemu.ini in this slashes are different – Pratik Aug 04 '11 at 04:53
  • 1
    possible duplicate of [I have problem in a emulator](http://stackoverflow.com/questions/6774368/i-have-problem-in-a-emulator) – Rob Hruska Aug 22 '11 at 14:25
  • Check my answer to query, http://stackoverflow.com/questions/9009872/android-eclipse-panic-could-not-open/14745968#14745968 – Swaroop Sep 23 '13 at 12:21

5 Answers5

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.

Daniel S. Fowler
  • 1,982
  • 15
  • 12
9

I was having this problem also but finally found a solution.
What you need to do is:
1. Create a new Windows system variable called ANDROID_SDK_HOME and set it to the directory of your Android SDK installation
2. In your "eclipse\configuration.settings\org.eclipse.ui.ide.prefs" file, also add a definition for ANDROID_SDK_Home

Then, all of your AVD files will be created in your "android-sdk/.android/avd" folder

Amil
  • 503
  • 1
  • 5
  • 13
5

Solution is as follows:

  1. Set the environment variable: ANDROID_SDK_HOME value of your SDK directory. As I have is: variable name ANDROID_SDK_HOME value of the E:\java\androidsdk

  2. Modify the configuration file in the eclipse installation directory. Locate the following files: eclipse \ configuration.settings \ opened of org.eclipse.ui.ide.prefs, in a later supplement to change just to configure the environment variables.

    As I add is: ANDROID_SDK_Home = E\:\\java\\androidsdk (Note that the slash format)

  3. Restart eclipse, reconstruction of the AVD can be run successfully.

Community
  • 1
  • 1
magyk
  • 51
  • 1
  • 1
3

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
2
  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