Hello Android application not working - android

Today I have started with setting up of Android Development Environment using Eclipse for java developers, Android SDK and ADT Plugin on Windows 7 exactly following the steps given on http://developer.android.com/resources/tutorials/hello-world.html but I'm stuck in between. I have written HelloAndroid application in same way as described on this link but when I'm running this code then it is not working. Following errors are shown in red:-
[2011-07-11 23:25:36 - Emulator] invalid command-line parameter: Files.
[2011-07-11 23:25:36 - Emulator] Hint: use '#foo' to launch a virtual device named 'foo'.
[2011-07-11 23:25:36 - Emulator] please use -help for more information

It's a new bug. You have to install your android sdk to a path that doesn't contain spaces. So c:\program files\android would fail, try c:\android.
Alternatively, you could first run your emulator by browsing to your androidsdk\tools folder, and open a command prompt there. Then use
emulator #foo
where foo is your avd name.
(You can also ofcourse, if you have one, deploy the application on your android phone, generally faster and easier to use)

Related

Android simple program run error

I have just installed Android SDK to my Eclipse, but when I run a simple program on Eclipse I get following error.
[2012-05-02 11:15:11 - Emulator] invalid command-line parameter: and.
[2012-05-02 11:15:11 - Emulator] Hint: use '#foo' to launch a virtual device named 'foo'.
[2012-05-02 11:15:11 - Emulator] please use -help for more information
I added ADT plugin to Eclipse and also set path for Android SDK as
C:\Documents and Settings\ganesh\android-sdk_r12-windows\android-sdk-windows
Where did I go wrong?
Thanks
Ganesh.
Android sdk path can't contain any spaces.So your path
C:\Documents and Settings\ganesh\android-sdk_r12-windows\android-sdk-windows is wrong.
Put your sdk in a path like c:\android-sdk that containes no space.
I second Rasel, another workaround is changing the "SDK Location" in the Android Preferences in Eclipse to its corresponding 8dot3 directory name, As here "Documents and Settings" is causing the problem, change it to its corresponding 8dot3 directory name, that would probably be DOCUME~1 so the comple path would be
C:\DOCUME~1\ganesh\android-sdk_r12-windows\android-sdk-windows
If you don't know the 8dot3 name of your desired path, just use command prompt and execute "DIR /X"
Its a very commmon issue and a bug with Android SDK. "Documents and Settings" have spaces and it breaks it.
You have 2 options
Re-Install SDK and avoid having spaces in the folders.
instead of Documents and Settings replace it with DOCUME~1 if not then DOCUME~2 (some dos path)
e.g. C:\DOCUME~1\ganesh\android-sdk_r12-windows\android-sdk-windows
I hope you'd like the secound option as you don't have to re-install SDK again. It works for me.

Unable to start an Android emulator

I've just installed Eclipse with fresh Android SDK and ADT on Windows 7 x64 Professional. I've created an emulator and tried to start it, but starting fails with this message:
invalid command-line parameter: Files.
Hint: use '#foo' to launch a virtual device named 'foo'.
please use -help for more information
When I create another emulator, it also fails to start with the same message. Can anyone provide a solution? Thanks in advance.
Change the path of Android SDK to make sure it has no spaces, for example use Progra~1 instead of Program Files.
Don't use a path that contains withespace for the SDK installation.
You can also try from command line:
emulator #foo
considering that your PATH includes the SDK installation directory.

Unable to launch the android emulator from Eclipse 3.7.0 [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicates:
Not able to launch android emulator
Starting the Android emulator in SDK tools, revision 12
http://developer.android.com/sdk/eclipse-adt.html#installing I followed the instructions here for a windows 7 machine using a 64 bit operating system. It's a clean system install. I first installed the Android SDK and then installed Eclipse and then installed the ADT Plugin.
At first, simply nothing was happening. I'd click window-> android and it'd bring up the list of emulators I had made. I'd select one then click start and nothing. ADB.exe wasn't even in my systems resources. I made sure Kaspersky had added adb.exe to it's trusted list and tried again, still no dice.
I then saw an article saying I should move adb.exe from platform-tools to just tools so I tried that. That made it switch from doing nothing (and reporting nothing in the console or logcat) to where it is now. It says
invalid command-line parameter: Files.
Hint: use '#foo' to launch a virtual device named 'foo'.
please use -help for more information
Any more theories on what I can try would be greatly appreciated.
For further clarification the foo message happened with platform of 2.3.3. or 3.2 selected. When trying platform 3.0 it went back to nothing.
I had the same problem which was quite annoying me until I found a "fix" (well it does not solve the problem at its roots but helps a lot anyway):
Simple create a batch file with the following content:
CD "C:\Program Files\Android\android-sdk\platform-tools"
adb kill-server && adb start-server
Of course you have to adjust the correct android platform-tools path.
So whenever a running emulator is not recognized by Eclipse or DDMS simply run this batch.
I had this trouble when my SDK was installed in 'Program Files'.
The invalid command line parameter was the space in the program files part of the argument. I guess Android coming from a Linux world means that whitespace is it's enemy! Despite this being the default install location.
I moved the whole SDK (emulator included) to the root 'C:\' drive. It then started working a treat.
There is bug on the windows version.
Open a command line prompt in the /tools/ folder (which you can find in the sdk folder) then run the emulator-arm.exe -avd nameOfYourVirtualDeviceHere
(btw this will not fix the real issue but allows you to continue to work)

Android virtual device failing to load at runtime

even if i'm trying just a simple android "hello world" program. On debugging following problem popping up..
" the android emulator process has unexpectedly stopped running. the instance and2.2 (its the name of avd i hd created) is now stopped.
Reason:
The emulator process terminated unexpectedly: invalid command-line parameter: Files.
Hint: use'#foo' to launch a virtual device named 'foo'.
please use -help for more information"
it's probably because the path is in Program Files or something on Windows. Put the android sdk folder into a path without a space.
sdk path can't contain spaces.May be you changed your sdk path to somewhere like c:/program files/...Which contains spaces.Please place it in a directory which contains no spaces

Issue creating AVD on command prompt in windows XP

I am the beginner for android development. I followed the procedure as specified in developer.google.com . for installing I Tried to create AVD(Android virtual device) through command path. I executed at command prompt.
android create avd --target 2 --name my_avd
But the Error is coming "Error: Target id is not valid. Use 'android.bat list targets' to get the target ids."
After executing android.bat list targets is showing blank. I am not able to figure out the problem as I have already set the path also.
THe problem is resolved. windows by default is not loading api for android virtual device. we need to manually start the downloading of those. follow this procedure:
go to android List item sdk folder which u have extracted. to the tools folder
un android batch file a api would be loaded. Here go to settings and mark "Force https to fetch from http".
Then go to availabe packages and amrk the link provided and install it.
after following this procedure all the above specified errors would be resolved.
I think you use "android create avd -n xxx -t 2" to create AVD, and use "android.bat list targets" to find the creation result.
You should use "android list avds" to list AVD. Targets is different from virtual devices.
You may have no targets installed. Check available packages in sdk manager and install some.
As per dtmilano, install some packages [images of the different Android OS versions]. This is an easy step to miss.
FYI: here are the end-to-end steps for installing an app on the emulator using the cmd line tools on MacOS (I assume win64 is equivalent):
http://richardboardman.com/2011/07/100-days-of-tech-day-1-android-dev-tools/

Categories

Resources