7 August 2011

How to fix problem with "Invalid command-line parameter:Files. Hint: use '@foo' to launch a virtual device named 'foo'."

Issue happen to Android SDK v12 only!(On some post they mention that it affect v11 as well).

So you decided to  learn how to write first program in Android and you follow by instruction on android website or other book, tutorial and you run your program and you see

[2011-08-07 23:12:04 - Emulator] invalid command-line parameter: Files.
[2011-08-07 23:12:04 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'.
[2011-08-07 23:12:04 - Emulator] please use -help for more information

... ERROR? and you thinking WTF ? Some aggressive people probably will try punch monitor or throw away android phone but ... try to calm down and read, because i have solution for you.

Apparently. Google mess up something and Android SDK location cannot contain any spaces ,so if you install to default location in Windows you are screwed ,because default path is usually
C:\Program Files\Android\  - where is one space in Program Files
or if you use 64bit version of Windows 7
C:\Program Files (x86)\Android\

As Google said:
"Hi everyone, to summarize:
- Yes there will be a fix. We're working on it.
- The primary workaround is install in a path with no spaces, e.g. c:\android\
- If that's not a choice, the second workaround right now is to use the "short path" Windows notation, e.g. "C:\PROGRA~1" either on command lines or in the Eclipse prefs.
Remember that the number might change depending on your directories; you can use "dir /X c:\" in cmd.exe to see the exact short path for a given directory."
So what to do ?
2 choices

Reinstall Android SDK to folder

In eclipse/netbeanse change path to:
for default 64bit OS
 C:\Program Files(x86)\Android\android-sdk

and for rest OS is usually
C:\Program Files\Android\android-sdk

If both doesn't work follow advice from above quote.

I hope my fail start with Android development  was only a one-time issue.Should I be hopeful or hopeless ?