Getting error in starting Emulator - android

When I run my application, I am getting an error. The error is:
invalid command-line parameter:
sw\android-sdk-windows\tools/emulator-arm.exe. Hint: use '#foo' to
launch a virtual device named 'foo'. Please use -help for more
information
What can I do to fix this?

This is because your sdk path in eclipse contains "Program Files", which contains space. Instead of "Program Files" do it PROGRA~1. This should solve the issue.
EDITED
To find the small names of your directories -
Open a command prompt go to your parent directory and fire this command - DIR/X and you will get list of small names for all of your directories. Replace any name with space with the name you get here.

I got the following error in Windows 7 with Android Emulator
invalid command-line parameter:Files.
From Stack Overflow Suggestion I tried the mlink suggestion as follows:
C:>mklink /D "D:\Android\" "c:\Program Files (x86)\Android\android-sdk-windows\"
In the eclipse Change the location of Android location.
Help --> Prefrences -> SDK Locatoion to D:\Android
Run an application from eclipse, it will show the output in emulator.
(Note : It is not possible to start emulator from SDK Manager Directly)
www.rajaramsystems.com/blog

Related

Is this Android Studio bug or am I doing wrong?

I have android studio setup on my Ubuntu machine and now whenever I try to start the emulator, it throws exception like:
Cannot launch AVD in emulator.
Output:
PANIC: Could not find
Nexus_S_API_21.ini file in $ANDROID_AVD_HOME$ nor in $HOME./android/avd
So when I do:
echo $ANDROID_AVD_HOME
It shows empty which means that this path is not set and when $HOME is my /home/user
So when I go in /home/user/.android/avd there is really no .ini file. So, I am confused, when I create a virtual device, where does it go? How can I find the path where virtual devices are being created and if possible, how can I change the path to create virtual devices?
You can find location of your avd's *.ini files in AVD Manager (GUI).
Right under tab "Android Virtual Devices" there is line "List of existing Android Virtual Devices located at %here is the location%".
You can try to change system variable %android_avd_home% to something like /home/user, for example and then restart IDE (Android Studio).
Also, you can try to find useful information here: https://code.google.com/p/android/issues/detail?id=78577
Hope it helps
I experienced this same issue on OSX, but the weird part was it only happened after I had added the ANDROID_SDK_HOME varible to my environment.
I experimented and found that if I added the ANDROID_AVD_HOME variable to my environment or I removed ANDROID_SDK_HOME, it caused it to start working.
One solution at this problem is to copy the file's emulator which exited and rename it in the name of the new emulator; that is say the android studio name of emulator who is try to run.
NB : Before I suppose you had install the eclipse ADT which contains one or some emulator
Example :
1) cd .android/avd/
2) ls -al
3) cp .ini .ini
4) Finish run the emulator in your android studio by the AVD
This happens on Windows when the user home folder is changed from the default one. To make Android Studio happy just add a system enviroment variable and set it to your home folder, for example:
ANDROID_SDK_HOME = D:\Users\max\

Unable to run Android Virtual Device Manager "android avd" getting NullPointerException

Getting NullPointerException when trying to start avd. I just downloaded the ADT bundle for Mac and ran android avd. Anyone know why it would fail?
$ ./android avd
java.lang.NullPointerException
at com.android.sdklib.internal.avd.AvdInfo.getDeviceName(AvdInfo.java:158)
at com.android.sdkuilib.internal.repository.ui.DeviceManagerPage.fillDevices(DeviceManagerPage.java:497)
at com.android.sdkuilib.internal.repository.ui.DeviceManagerPage.fillTable(DeviceManagerPage.java:357)
at com.android.sdkuilib.internal.repository.ui.DeviceManagerPage.createContents(DeviceManagerPage.java:259)
at com.android.sdkuilib.internal.repository.ui.DeviceManagerPage.<init>(DeviceManagerPage.java:130)
at com.android.sdkuilib.internal.repository.ui.AvdManagerWindowImpl1.createDeviceTab(AvdManagerWindowImpl1.java:210)
at com.android.sdkuilib.internal.repository.ui.AvdManagerWindowImpl1.createContents(AvdManagerWindowImpl1.java:193)
at com.android.sdkuilib.internal.repository.ui.AvdManagerWindowImpl1.open(AvdManagerWindowImpl1.java:133)
at com.android.sdkuilib.repository.AvdManagerWindow.open(AvdManagerWindow.java:94)
at com.android.sdkmanager.Main.showAvdManagerWindow(Main.java:369)
at com.android.sdkmanager.Main.doAction(Main.java:311)
at com.android.sdkmanager.Main.run(Main.java:119)
at com.android.sdkmanager.Main.main(Main.java:102)
The following worked for me:
From the command line I navigated to the tools folder of the Android-SDK folder. From there I ran this command:
android list avd
This produced a list of all of my virtual devices but one of them showed itself to be the problem. The exact output was as follows:
The following Android Virtual Devices could not be loaded:
Name: Tab31
Path: /Users/User/.android/avd/Tab31.avd
Error: Failed to parse properties from /Users/User/.android/avd/Tab31.avd/config.iniere
If you see this then make note of the "Name" property ("Tab31" in my situation) and run the following command (obviously replacing the name of my AVD with yours):
android delete avd -n Tab31
After that I was able to start the AVD Manager without any problem.
I had this exact same problem last night and finally found the ways to get the emulator to start working:
List the available targets with: android list targets
android create avd -n {name} -t {targetID}
(for {name} I chose Tablet - believe its arbitrary)
== Still wasn't working but then I discovered =>
I right-clicked above the manifest.xml file, selected option Run As ->
Run Configurations -> on a tab Target, and selected AVD created.
(from Eclipse launch error when trying to run an Android app)
If nothing of the above solutions work, deleting the .android folder in the home directory will work
I had this same problem after moving around my Android SDK and changing the base directory by setting the environment variable ANDROID_SDK_HOME. Turns out there is a path inside of the following file (path below ANDROID_SDK_HOME).
.android/avd/nameofphone.ini
The "path=" setting in that file is absolute, so if you move around your files it will not be correct anymore. Changing that to the correct absolute path to the avd-file in the same directory fixed my issue.
It's usually because creation of a new AVD failed or the configs for one of your AVDs is corrupted.
Go to ~/.android/avd
Check the list of AVDs. If you think one of those AVDs is causing the problems, sudo rm -r (UNIQUE PART OF AVD NAME)*
This removes that AVD. Then re-try android avd
#BreakingBad's solution works fine except when the config is corrupted
It looks like this issue has been fixed in version 21.0.1 preview 1 of the SDK Tools.
http://code.google.com/p/android/issues/detail?id=40400
The most likely cause is an invalid properties file that could not be parsed by the AVD Manager. Updating to the Preview Channel of the SDK Tools should fix this, or you can just wait for the official release.
Once I updated, the AVD Manager started and showed an invalid AVD in my list, which I was able to delete.

Android : failed to start emulator

I am unable to start my android emulator in eclipse . I get hit with the following error message always
"Failed to start emulator: Cannot run program "/Users/anandmadhusoodanan/Desktop/Assignments/Spring-2012/Embedded_Systems_Programming/android-sdk-macosx//tools/emulator": error=1, Operation not permitted" where
"/Users/anandmadhusoodanan/Desktop/Assignments/Spring-2012/Embedded_Systems_Programming/android-sdk-macosx" is the path of my sdk.
I have tried re-installing the ADT plug-in, the sdk and even eclipse.
I am using Mac OS.
The # symbol indicates that there are extended attributes for the files in question. To verify the extended attributes applied to the files use:
ls -l#
You'll probably find (as I did) that there is a com.apple.quarantine attribute on the files which can be removed with:
xattr -dr com.apple.quarantine sdkFolder
Where sdkFolder should be replaced with the name of the folder you extracted the SDK to.
Check that you have execute permissions on the emulator
Try
$chmod 755 emulator

Not able to launch android emulator

When I run my hello world application, the android emulator fails to launch.Even when i am creating a new emulator it fails to launch giving me the following error.
[2011-08-09 17:03:10 - Emulator] invalid command-line parameter: Files\Android\android-sdk\tools/emulator-arm.exe.
[2011-08-09 17:03:10 - Emulator] Hint: use '#foo' to launch a virtual device named 'foo'.
[2011-08-09 17:03:10 - Emulator] please use -help for more information
First of all you need to check are you in correct folder?
$...local\Android\sdk\tools\emulator -list-avds
If so it will show you list of emulators that you have in your Android studio you are on right track
Last part for launching an emulator
local\Android\sdk\tools\emulator -avd Nexus_5X(name of your emulator you want to open)
The problem is, that you have specified your SDK in a file what has space, in its name For example: Android SDK You need to change it to something what hasn't got space in its name.
Hope it helps.
Or if you specified it in the Program Files use it:
Progra~1 instead of Program Files.
You are not specifying what AVD to launch. Please read the SDK docs in full, they will show you how to do this.
Tip: Launch the "android.exe" (I think, I use Linux where it's simply "android") app instead, create an AVD and launch it, all from the graphical interface.
The tricky part is finding name #foo
to find exact name of emulator run android command line emulator -list-avds aka ~/Library/Android/sdk/tools/emulator -list-avds
2.it will show you emulator names but emulator names that you pass to command line
bonus: you probably will get PANIC error in that case you need to add ANDROID_PATH read more here https://stackoverflow.com/a/49511666/6133329
On windows don't install the Android SDK to a path with spaces in it like C:\Program Files\AndroidSDK. Instead install it to C:\AndroidSDK\ or something like that.
Try this It worked for me...
emulator #avd_name [ {-option [value]} … ]
Type command emulator #youremulatorname
For more Check out this Link
For Windows
Check whether you have an emulator on your PC.
If it is there add the path below to the environment variable
C:\Users%username%\AppData\Local\Android\Sdk\emulator
and
remove C:\Users\deepank\AppData\Local\Android\Sdk\tools
:

The Android emulator is not starting, showing "invalid command-line parameter"

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?
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.
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.
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\.
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.
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.
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.
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.
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.
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!
Remember to run "android update avd -n avd_name" after change in Android SDK path.
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.

Categories

Resources