Starting the Android emulator in SDK tools, revision 12 - android

I updated the Android SDK tools from revision 11 to revision 12, and the emulator now fails to start. When I try to run emulator.exe, I get:
invalid command-line parameter: Files\Android\android-sdk\tools/emulator-arm.exe.
Hint: use '#foo' to launch a virtual device named 'foo'.
please use -help for more information
The path to emulator.exe is C:\Program Files\Android\android-sdk\tools.
How do I fix it?

As was previously suggested, it does seem to be caused by the fact that there is a space in the default installation path of the Android SDK: C:\Program Files\Android\android-sdk\
There are a couple of possible solves, though-
move installation directories to paths that do not contains spaces (as already mentioned)...
but simpler and possibly slightly less cumbersome is simply adjusting the path in Eclipse to use 8-dot-3 directory name(s). Since I'm running Win7, I have two Program Files directories, the second one being "Program Files (x86)" which is where the sdk installed. So the 8-dot-3 path is PROGRA~2. Thus, I simply changed the "SDK Location" value in the Android Preferences in Eclipse from C:\Program Files\Android\android-sdk\ to C:\PROGRA~2\Android\android-sdk\ and everything now works fine.
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.

Same problem for me, though this is my first time trying to work with Android SDK in general. I believe the problem is with the location of the SDK. Note the "paramater" "Files\Android\android-sdk\tools/emulator-arm.exe." I believe there is a bug in google's code where it doesn't have the directory the SDK is located in in quotes, meaning, if there is a space anywhere in the directory name, it won't work. Can someone with their SDK in a directory with no spaces confirm my theory?
To work around the issue, you can call "C:\Program Files\Android\android-sdk\tools\emulator #foo" from the command line, where "foo" is the name of your emulator.

I got this problem just now, and I found a solution.
My path to the emulator-arm.exe is C:\Program Files\Android\android-sdk\tools. When I try emulator-arm #my_avd from the command line (my_avd is my Android Virtual Device name), it works.

I fixed this problem on Windows XP. Just cut from "C:\Program Files\Android\android-sdk" and paste content directory to "C:\Android\android-sdk". Set my system varaible 'ANDROID_HOME'="C:\Android\android-sdk". Set path to Android SDK in Eclipse as "C:\Android\android-sdk". That's it!
Everything works fine.

Since the cause of this issue is the space within filepath names of the Windows install directory then another workaround is to use the file short names (i.e. 8.3 alias filenames).
Specifically, if root install directory for Android SDK is
c:\Program Files\.. then use c:\PROGRA~1\..
or if
c:\Program Files(x86)\.. then use c:\PROGRA~2\..
You can then launch the SDK Manager via the command-line by running:
start c:\PROGRA~2\Android\android-sdk\tools\android.bat

Fixed in r13. Update your SDK Tools!

I think you are saying you changed the minSDK version of your app and now the emulator wont run...? this is because your emulator is the wrong version... assuming you changed the minSDK of your app correctly, all you need to do is create a emulator with the same SDK version. Open the Android SDK / AVD manager (icon top right of screen next to print token) and create a emulator with minSDK 12.

Moving your Android SDK folder to somewhere that the complete path will be without white spaces will fix the problem.

I also got this problem after updating SDK Tools from revision 11 to 12.
I found it was a problem with a space in the upper directory name where android-sdk-windows resides, then I copied both 'eclipse' and 'android-sdk-windows' directories from my 'Program Files (x86)' to the root of drive D:.
All is solved now!

As an alternative to PROGRA~2 method (which is not working for example in Intellij IDEA), you can create a symlink named, for example, prg to Program Files (run mklink /? from command line to learn how to do it), then run emulator as C:\prg\Android\android-sdk\tools\emulator.exe. Change path to SDK/emulator in your IDE also.

I had a same problem when I setup r12. I found out this problem was caused by blank spaces in the path you setup android SDK. The solution is that you should move the folder of android SDK to a place without spaces, in your case : E:\andriod-sdk or D:\abc\xyz\android-sdk.

Related

Android SDK location should not contain whitespace, as this cause problems with NDK tools

Recently I have installed the last version of Android Studio (Android Studio 2.1), keeping the old 1.2 version previously installed. Now i have Android Studio 2.1 and Android Studio 1.2. In Android Studio 1.2 when I click on SDK Manager it works properly, but in Andorid Studio 2.1 this problem appears:
how can I fix keeping the two versions of Android studio? Thanks
As the warning message states, the SDK location should not contain whitespace.
Your SDK is at C:\Users\Giacomo B\AppData\Local\Android\sdk. There is a whitespace character in Giacomo B.
The easiest solution is to move the SDK somewhere else, where there is no space or other whitespace character in the path, such as C:\Android\sdk. You can point both Android Studio installations to the new location.
There is another way:
Open up CMD (as Administrator)
Type: mklink /J C:\Program-Files "C:\Program Files" (Or in my case mklink /J C:\Program-Files-(x86) "C:\Program Files (x86)")
Hit enter
Magic happens! (Check your C drive)
Now you can point to C:\Program-Files (C:\Program-Files-(x86)).
just change the path:
"c:\program files\android\sdk" to "c:\progra~1\android\sdk"
or
"c:\program files (x86)\android\sdk" to "c:\progra~2\android\sdk"
note that the paths should not contain spaces.
It is possible to make a symbolic link from e.g. C:\Android\sdk to the actual location of the sdk (which contains whitespaces), and refer to this symbolic link from within Android Studio as the location of the SDK. I have, however, not tried whether NDK will work with such a setup, even though Android Studio stops giving this warning about whitespaces.
As long as you aren't using the NDK you can just ignore that warning.
By the way: This warning has nothing to do with parallel installations.
Simply....If you are not using NDK, there is no problem at all. On the other this is just warning not an error. With warning you can go ahead but not errors. Any it's better to adjust the whitespaces.
E.g if your SDK is at C:\program file\Android studio. There is a whitespaces "program file".
There are 2 simple methods:
1. Remove the whitespaces
2. Install at another location which don't have whitespaces.
I have the same error, make some change in the path C:\Users\Juan Jose\App---- to
C:\Users\JUAN~1\App.
CMD Command (Windows) go to root c:\Users
Type de command DIR /X
Here show a Short name of Juan Jose
Reemplace the name Juan Jose with the Short Name give it.
Copy your SDK folder and paste it in another folder without spaces (for example: "D: / Android / Sdk"), then open the SDK Manager, and change the Android SDK Location to the location of your new SDK folder
Just change
C:\Users\Giacomo B\AppData\Local\Android\sdk
to
C:\Users\Giacomo_B\AppData\Local\Android\sdk
I just wanted to add a solution for Mac users since this is the top article that comes up for searches related to this issue. If you have macOS 10.13 or later you can make use of APFS Space Sharing.
Open Disk Utility
Click Partition
Click Add Volume -- no need to Partition as we are adding an APFS volume which shares space within the current partition/container)
Give the volume a name (without spaces)
Click Add
You can now mount this drive like any other via Terminal: cd /Volumes/<your_volume_name>
Create an empty folder in the new volume -- I called mine sdk
You can now select the volume and directory while installing Android Studio
your sdk file path does not have whitespace like this./abc aaa/sdk it like ./abc_aaa/sdk this.
you know that this is does not do anything with your java and xml. It only affect the ndk which is for native apps or to use c++/c. so if you are just using java and xml or even kotlin there is no side effect with that thing
Just remove white space of all folders present in the given path for example Program Files
You can remove it by following steps->
Open elevated cmd,
In the command prompt execute:
mklink /J C:\Program-Files "C:\Program Files"
This will remove space and replace it with "-".
Better do this with both sdk and jdk path.
This works :)

Will SDK Manager suppport for windows-8

Will SDK Manager support for windows-8. I installed the android sdk for Windows 8.
But when I open the android sdk manager, a cmd-like screen just briefly flashes on for half a second then disappears. I have no idea what's going on and how to get this thing working.
I am facing same problem on Windows 8.1.
I saw following solution on internet:
Open /sdk/tools/android.bat file.
and
change
“set java_exe=” line to
set java_exe="C:\Program Files\Java\jre7\bin\java.exe"
Note:
The java.exe path could be different on your system.
But it didn't work in my case, try it on your side.
One thing strange is that if we run "/sdk/tools/android.bat" directly it works, but it does not run through "SDK Manager.exe" file.
Any other person facing same problem and got any solution?
Will SDK Manager support for windows-8
Yes, it works perfectly in Windows 8 also.
Follow below steps which worked for me :-
Go to (sdk-folder)/tools folder (For me it is C:\Users\Ajay\adt-bundle-windows-x86_64-20131030\adt-bundle-windows-x86_64-20131030\sdk\tools)
Open the file android.bat in any text editor.
Go to the line where set java_exe is located
Set the Path of java.exe which is located in your JRE. For ex : set java_exe="C:\Program Files\Java\jre7\bin\java.exe"
Save the file and try it again, now it should work !
Match your Machin's Java bit system with your android SDK bit system, i.e install a JDK x86 if you got android SDK x86. And usually android SDK works fine with Java x86 versions.

Cannot find 'emulator.exe' when trying to test apps

I'm working with KonyOne Studio to build and test apps. The Android SDK is located in C:\Android\adt-bundle-windows-x86_64-20130729\sdk and the emulator is located at C:\Android\adt-bundle-windows-x86_64-20130729\sdk\tools\emulator.exe. When I try to run apps, I get the error:
Windows cannot find 'emulator.exe'. Make sure you typed the name
correctly, and then try again.
When I just run the emulator.exe executable, I get a quick cmd screen and it disappears as quick as it appeared. Nothing shows up in my task manager.
I've set the following environment variables:
JAVA_HOME: C:\Java\jdk1.6.0_32
PATH: C:\Java\jdk1.6.0_32;D:\Users\SIMONSJP.GROUPINFRA\AppData\Roaming\npm;
C:\KonyOne\ImageMagick;C:\apache-ant-1.9.2\bin;C:\Java\jdk1.6.0_32\bin;
C:\Android\adt-bundle-windows-x86_64-20130729\sdk\platform-tools;
Ofcourse the above is without spaces. I don't understand why the emulator doesn't run. Can anyone figure out why it isn't working?
Your path variable only includes platform-tools. It needs to include the path to the emulator too.
Two ways:
Copy the emulator.exe to platform-tools
add the tools folder to path variable.
Extract your sdk zip at some other place, copy tools directory, replace it with your actual sdk tools folder contents.
Restart eclipse if required...
This worked for me.Hope same happens with you too...

Can't get Android SDK Manager to open

Having searched here and elsewhere for answers to my problems, I'm still unable to fix this.
I've installed Eclipse, ADT Plugin, and the Android SDK. My problem is that the SDK Manager won't open, whether it is launched from Eclipse or directly. The command prompt window flashes up briefly, then closes.
I've tried several proposed solutions: Various configurations of my Path and JAVA_HOME variables, installation of the 32 and 64 bit versions of the JDK, running as Administrator, all with no success.
The different components are installed at these paths:
JDK - C:\Program Files\Java\jdk1.7.0_11
JRE - C:\Program Files\Java\jre7
SDK - C:\ADT\sdk
My JAVA_HOME is set to C:\Program Files\Java\jdk1.7.0_11
My Path includes C:\Program Files\Java\jdk1.7.0_11\bin at the beginning.
I've tried reinstalling the SDK and the installer correctly identifies the location of Java, and yet still it won't work.
Can anyone help me out with this? I'm practically tearing my hair out!
Open cmd,
go to android sdk folder,
in tools/lib/, edit find_java.bat,
you will see the lines like below, add black line to your file and save.
rem Check we have a valid Java.exe in the path. The return code will
rem be 0 if the command worked or 1 if the exec failed (program not
found). for /f %%a in ('%~dps0\find_java.exe -t') do set java_exe=%%a
this
set java_exe="C:\Program Files\Java\jdk1.7.0_11\bin\java.exe"
if not defined java_exe goto :CheckFailed
:SearchJavaW
rem Check if we can find a javaw.exe at the same location
than java.exe. rem If that doesn't work, just fall back on the
java.exe we just found. for /f %%a in ('%~dps0\find_java.exe -t -w')
do set javaw_exe=%%a if not exist %javaw_exe% set javaw_exe=%java_exe%
set javaw_exe="C:\Program Files\Java\jdk1.7.0_11\bin\java.exe"
i hope it helps
Answer by Talha is correct. Just adding that you might need to NOT include quotation marks in the black lines in his solution.
The following addition worked for me:
set java_exe=C:\Program Files\Java\jdk1.7.0_11\bin\java.exe
Found out what the cause of this problem was in my case: In the registry, there was a setting to have the CMD using UTF-8 (chcp=65001).
If I double click C:\Programmer\Android\SDK Manager.exe, I get the described symptoms.
If double click C:\Programmer\Android\sdk\tools\lib\SDK Manager.exe there is a hint:
A pop-up stating: Failed to execute tools\android.bat
Starting a CMD window in C:\Programmer\Android\sdk\tools and running android.bat, gave no output, even if editing the file and reming out the initial #echo off. Running the command chcp returned 65001.
So changing the codepage with chcp 850 and then running android.bat again, I got output, ending with the line: call lib\find_java.bat. This turned out to be the same problem. Each time a new CMD was spawned, the codepage changed to 65001
Fixed the problem by editing the following registry entry, deleting the value, and everything worked:
HKEY_LOCAL_MACHINE->SOFTWARE->Microsoft->Command Processor->AutoRun: #chcp 65001>nul
Having an empty value here, make the CMD using codepage 850, and the bat files begin to work again.
I am not quite sure what has made this change in the first place, but now I know the cure.
When extracting the adt-bundle-windows-x86_64-20131030.zip, three files were broken:
("sdk/tools/lib/httpcore-4.1.jar","sdk/tools/lib/find_java.exe","sdk/tools/lib/sdk-common.jar")
I don't know why but you can replace these files using old versions of android SDK e.g. android-sdktools_installer_r20.0.1-windows.exe. It worked for me.
After much searching.......and installing...re-intalling.....and changing the path of the android.bat as the answers above mentioned.....the final solution was: running Eclipse or the bat file or Android studio as administrator in windows 8 for the manager to open up!
check the md5 checksum for eclipse and android SDK.It might be an md5 check sum problem.
for calculating the md5 checksum of files u downloaded you can go to http://www.guidingtech.com/9800/what-is-md5-checksum-how-to-verify-it/
for correct md5 checksum :-
1. for eclipse go to link their official download site click on
downloaded package that u downloaded then go to check sum just match it with ur eclipse downloaded file.
2.for android sdk go to http://developer.android.com/sdk/index.html and click on download for other platformsand match the md5 checksum (f09aa4557bd1dc2703fde95dcdd6b92e).
i my case i downloaded all that stuff four times.
with regards
ajay
This could also happen if you haven't installed Java on your machine. I had a similar problem but after installing java it worked for me. You can download Java from https://www.java.com/en/download/help/download_options.xml.
Regards,
Abhi
Follow these steps and it help for me after a long time with all ways above not effect on windows7 64-bits, no need to have JAVA_HOME system variable or edit android.bat
Download Android Studio within Android SDK, Java JDK 64 bits and Java JRE x86
Install Java JRE first, then install Java JDK 64 bits, and the Android Studio last.
Now you start Android Studio first (64 bits version) it require to have JAVA_HOME setting to run JVM, just copy the jdk.x.x.x(version) folder (my PC: jdk1.8.0_25 from "C:\Program Files\Java\")folder to Android Studio folder and rename that folder (in Android Studio) to "jre" (jdk1.8.0_25 -> jre).
Now it work for me to open Android SDK Manager from anywhere, if you want to use eclipse (not official now) just copy the java jre.x.x.x(version) x86 folder (from where you install before) to Eclipse and rename to "jre". After coping, choose the Android SDK path in Eclipse to use, It works for both Android Studio and Eclipse.
Mind your antivirus if still refusing you (remove antivirus and install after you sure it not cause problem)!
cmd this "android.bat update sdk" ,this way can open "SDK Manager.exe"
note
1."D:\SDK\android-sdk-windows\tools" PATH in enviroment.
2.Replace sdk "tools" folder, this is site -> https://developer.android.com/studio/index.html, then select "Get just the command line tools".(new version deprecated "SDK Manager.exe")
this way worked for my Android Studio 2.3
3.and if "android.bat update sdk" can't work, see this video-> https://www.youtube.com/watch?v=FMLVY3PqPlc
I have tried all the above methods none of them worked.If you have already installed jdk-10 or any other then uninstall it and install jdk-8. If you created the path variables then immediately remove the 'JAVA_HOME' variable and also remove the java path from 'PATH' variable. Then install the jdk-8, and try to install sdk manager it works perfectly.
I found another solution, assuming you have Android Studio installed on your system:
Open Android Studio
Open settings (Control + Alt + S)
Locate "Android SDK" setting (Appearance & Behavior -> System Settings)
On the right side, you'll have the SDK related tabs
Try This >
Go to sdk folder
Right Click on Sdk Manager then Run as A administrator .
It will open sdk manger and your problem will solve

Trouble getting Android emulator to run in eclipse

I'm trying to run the SDK Samples on the Emulator in Eclipse 3.5.
Most of the time the AVD Manager hangs when I try to create a new AVD.
When I manage to create an AVD and try to start the emulator I get this:
emulator: ERROR: no search paths found in this AVD's configuration
weird, the AVD's config.ini file is malformed. Try re-creating it.
I'm running the latest version of the SDK on Win7 32 bit. Any ideas?
Update:
I think I found the source of the problem. I'm running a Hebrew version of WIN 7. My user name is in Hebrew. Apparently this causes a problem for Eclipse. Once I started to suspect that was the problem, I created a new user on the system called DEV and tried to run the emulator under that user. Went like butter.
You can set the environment variable ANDROID_SDK_HOME. For example:
ANDROID_SDK_HOME=D:\Development\android-sdk\
It helped me. Add this variable to <eclipseFolder>\configuration\.settings\org.eclipse.ui.ide.prefs:
ANDROID_SDK_HOME=D\:\\Development\\android-sdk\\
Stop the process adb.exe and (re)start Eclipse.
The problem here is that my c:\users... path has foreign characters in it "Michael Schøler" - the "ø" being the problem.
This is an ecclipse and/or Android SDK problem.
move c:\Users\YourName\.android\avd\YourAVDName.avd manually to c:\Android\YourAVDName.avd then open c:\Users\YourName\.android\avd\YourAVDName.ini and change path from
path=c:\Users\YourName\.android\avd\YourAVDName.avd to path=c:\Android\YourAVDName.avd
Another rather simple solution to this problem (non-english characters in the AVD's path), is to use the "shortname" of the directories. In my case:
My windows user is "András", so my homedir is C:\Users\András
If you open up a cmd, cd to C:\Users, and issue a "dir /x" command, you will see the "shortnames" of the directories, in my case it is "ANDRS~1".
So you just change the path in the AVD's config file from C:\Users\András\blabla to C:\Users\ANDRS~1\blabla, and voila, it works.
If you have special character in your username do this:
~/.android/avd on OS X and Linux, C:\Documents and Settings\user\.android\ on Windows XP, and C:\Users\user\.android\avd on Windows Vista, 7.
There name.ini and name.avd folder
- copy the folder for example: C:\
- modifiy the path in the .ini to path=C:\name.avd
I had a similar problem because of non-latin letters in my username.
When opening the ini-file in a text editor I found the non-latin characters was wrong. So I just changed the path from
path=c:\Users\YourNa¤%"%¤%%¤me.android\avd\YourAVDName.avd
to
path=c:\Users\YourName.android\avd\YourAVDName.avd
and it worked.
To make sure everything is installed correctly, I recommend you reinstall all the components. To be sure everything goes correctly follow my step by step instructions on my blog.
http://androidcodemonkey.blogspot.com/2010/01/how-to-setup-android-development_23.html
If you follow all the steps you should be good to go!
Good luck.
I had the same error. What I found was that I was missing
ARM EABI v7a System Image.
I fixed it by opening the Android SDK Manager (The tool bar button looks like a little white arrow in a gray box with green android head)
I checked the missing system image and clicked the install button.
See this topic.
I also had the same problem since my username was in Cyrilic letters Димитров.
I change it to a latin alphabet and then it's OK.
You have to use Android tool from sdk\tools folder to move your AVD device to some Folder with no foreign characters in the path.
Just type android move avd -n "nameofdevice" -p "newpath"
For example: android move avd -n HTDDESIRE -p C:\HTCDESIRE
I agree with Zian, something is seriously wrong here and you should consider reinstalling. Also make sure of the following:
1) Make sure your avd folder looks sane. This can be found in the .android directory in your home directory. Look in ~\.android\avd\<name-of-avd>.avd\ and you should see config.ini and userdata.img files, plus an sd image if you created one. Make sure your config.ini looks something like this:
hw.sdCard=yes
hw.dPad=yes
hw.accelerometer=yes
hw.lcd.density=160
skin.name=HVGA
skin.path=platforms/android-1.6/skins/HVGA
hw.trackBall=no
hw.ramSize=256
image.sysdir.1=platforms/android-1.6/images/
Or, if you don't have any custom settings, then it will just consist of this one line:
hw.lcd.density=160
2) Make sure you have the latest version of the ADT Eclipse plugin (v0.95).
3) Also, you really truly shouldn't have any permissions problems within your home directory, but hey, it's Windows -- you never know. So you may want to manually set the permissions to the avd/ folder to read/write/execute, just to be sure.
4) Other than that, reinstall with extreme prejudice!
Try to download again the SDK, unzip it and reinstall through Eclipse.
Be sure to have the last version and have configured all the paths in Eclipse preferences correctly.
If you have installed the Android SDK to a different drive ie not C: then you might need to set the ANDROID_HOME environment variable to the location of the SDK installation
Another consideration I may have overlooked in others answers - I see you mentioned Eclipse 3.5 - consider using 3.5.2 (the current latest version)
May not matter, may have just been omitted by you, either way using the most up to date stuff never hurts.
One way is to don't exit the emulator after running. You edit the program without closing emulator. Do it every time.
This solved it for me on IOS: I looked in the actual .ini file for the device (Nexus-7-inch-tablet.ini) which looked like:
avd.ini.encoding=ISO-8859-1
target=android-17
path=/Users/stevensanborn/.android/avd/Nexus-7-inch-tablet.avd
path.rel=avd/Nexus-7-inch-tablet.avd
and removed and extra return space in the file. Resaved it and worked. Ridiculous.
The solution (that worked for me) was to add the following missing entries in my avd's config.ini:
image.sysdir.2=system-images/android-14/armeabi-v7a/
image.sysdir.1=add-ons/addon-google_apis-google-14/images/armeabi-v7a/

Categories

Resources