229

I made a simple "Hello World" program in Eclipse. I added nothing to a Java file and only added a text view in file main.xml as

//main.xml file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Hello World"
    />
</LinearLayout>

And now when I run my program it shows the following in the console.

//console output
[2011-07-10 07:10:22 - demo] ------------------------------
[2011-07-10 07:10:22 - demo] Android Launch!
[2011-07-10 07:10:24 - demo] adb is running normally.
[2011-07-10 07:10:24 - demo] Performing com.demo.DemoActivity activity launch
[2011-07-10 07:10:25 - demo] Automatic Target Mode: launching new emulator with compatible AVD 'vishal'
[2011-07-10 07:10:25 - demo] Launching a new emulator with Virtual Device 'vishal'
[2011-07-10 07:11:06 - Emulator] invalid command-line parameter: Files\Android\android-sdk\tools/emulator-arm.exe.
[2011-07-10 07:11:07 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'.
[2011-07-10 07:11:07 - Emulator] please use -help for more information

//--------------------------------------------------------------------------------/

This shows my Android Virtual Device (AVD) could not start due to some reason. What can I do to fix this problem?

1

11 Answers 11

317

There is currently a problem with R12 where the SDK location cannot contain any spaces.

The default installation location is: C:\Programme Files(x86)\Android\android-sdk. They are currently fixing the problem but you can currently work around it by changing the SDK location path in eclipse to C:\PROGRA~2\Android\android-sdk.

If you are running 32-bit Windows, change the path to C:\PROGRA~1\Android\android-sdk.

7
  • 30
    If you don't know the 8-dot-3 name of your desired path, just fire up a Command Prompt and execute "DIR /X"... the short name will be displayed next to each directory.
    – Jaya Mayu
    Commented Jul 27, 2011 at 10:40
  • Can this be fixed in Eclipse? Commented Aug 16, 2011 at 5:45
  • I've tried this and it's still not working on my 32 bit Windows 7 machine. My SDK is in the following path D:\Program Files\Android\android-sdk and I've put the following in my SKD location path in eclipse but with no luck. D:\PROGRA~1\Android\ANDROI~1 Commented Aug 19, 2011 at 0:34
  • 3
    I ended up just copying the android-sdk directory directly into the root of the D drive adn updated the SDK path in Eclipse to reflect the new location. Worked like a charm. Commented Aug 19, 2011 at 1:39
  • 8
    that is ridiculous, I reckon 99% of people encounter this problem when attempting to get started with android!
    – jcvandan
    Commented Sep 7, 2011 at 20:56
51

I'd suggest creating a directory junction named C:\Android pointing to the actual C:\Program Files (x86)\Android\android-sdk-windows\:

MKLINK /J C:\Android "C:\Program Files (x86)\Android\android-sdk-windows\"

and then setting the newly created junction as SDK Location for your Eclipse ADT Plugin (Eclipse menu\ Window\ Preference\ Android). This might help for a number of tools/ plugin too that have problems with spaces in paths.

1
  • 1
    Nice idea. You could also create it as a symbolic link, which is the newer way since Windows Vista.
    – Hosam Aly
    Commented Sep 21, 2011 at 21:14
33
  • If your SDK location path in Eclipse is in C:\Program Files (x86)\ change to C:\PROGRA~2\.
  • If you are running 32-bit Windows, C:\Program Files\, change the path to C:\PROGRA~1\.

enter image description here

24

NickC is correct. It is also worth pointing out that the SDK location is set in Eclipse > Window menu > Preferences > Android. If your folders are different you can check the 8.3 format of any folder with dir foldername /x at the command prompt.

15

I had this issue as well. The solution is (if you are on Windows as I am) to change the path to C:\PROGRA~1\Android\android-sdk-windows\.

Assuming Program Files is the first directory with the word PROGRAM in it which it should be. This worked.

7

I started Task Manager, made sure adb.exe is closed (it locks some files)

Create the folder C:\Android Moved folder + all files from C:\Program Files\android-sdk to C:\Android

Edited C:\Documents and Settings\All Users\Start Menu\Programs\Android SDK Tools shortcuts.

I considered uninstalling the SDK and re-installing, but for the life of me, where does it store the temp files?? I don't want to re-download the platforms, samples and doco that I have added to the SDK.

0
4

I had the same problem. I made it work with:

"C:\Program Files (x86)\Android\android-sdk\tools\emulator-arm.exe"  @foo

foo is the name of your virtual device.

1
  • likewise - how the heck did you do that phil??
    – ina
    Commented Sep 6, 2011 at 2:45
3

As an alternative to the PROGRA~2 method (which is not working for example in IntelliJ IDEA), you can create a symbolic link.

It can be named, for example, prg to Program Files (run mklink /? from the command line to learn how to do it). Then run the emulator as C:\prg\Android\android-sdk\tools\emulator.exe. Also change the path to SDK/emulator in your IDE.

2
  • 1
    Be careful when posting copy and paste boilerplate/verbatim answers to multiple questions, these tend to be flagged as "spammy" by the community.
    – Kev
    Commented Jul 12, 2011 at 18:31
  • 1
    @Kev What about duplicate questions? :P
    – Timothy003
    Commented Jul 12, 2011 at 19:51
3

emulator-arm.exe error, couldn't run. Problem was that my laptop has 2 graphic cards and was selected only one (the performance one) from Nvidia 555M. By selecting the other graphic card from Nvidia mediu,(selected base Intel card) the emulator started!

2

Remember to run "android update avd -n avd_name" after change in Android SDK path.

-2

This don't work since Andoid SDK R12 update. I think is because SDK don't find the Java SDK Path. You can solve that by adding the Java SDK Path in your PATH environment variable.

Not the answer you're looking for? Browse other questions tagged or ask your own question.