开发者

Android Emulator can't start, 'cause of wrong folder

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.


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.


  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.


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.


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\"


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜