Android Emulator - invalid command-line parameter: - android-emulator

When I try to launch my Android Virtual Device, I get the following error.
Files\Android\android-sdk-windows\tools/emulator-arm.exe.
Hint: use '#foo' to launch a virtual device named 'foo'.
Please use -help for more information.
I have been using the emulator for months, and I just downloaded new updates from SDK/AVD Manager.

This problem is caused by blank spaces in the path you setup in the Android SDK. The solution is that you should move the folder of the Android SDK to a place without spaces, in your case:
E:\andriod-sdk-windows
or
D:\abc\xyz\android-sdk-windows

Please refer to the Stack Overflow post Starting the Android emulator in SDK tools, revision 12 for a solution. It did not come up in the search, but it did correct my problem. The space in the path name (PROGRAM FILES) seems to be causing the problem. I took the renaming suggestion to change the path name to PROGRA~1, and my problem was resolved.

It looks like someone already reported this problem, Issue 18317: Emulator in R12 doesn't properly invoke emulator-arm.exe if the install path as a space in it
... 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 preferences. 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.
We'll have to wait for their fix but in the meantime we can just remove the spaces in the Android installation directory.

In Eclipse go to Windows -> Preferences -> Android and in your SDK location replace
C:\Program Files\android-sdk-windows with C:\PROGRA~1\android-sdk-windows

If you want to run the emulator only without eclipse you'll need to create a .bat file with the SDK short path:
for 32 bits machines:
C:\PROGRA~1\Android\android-sdk\SDK Manager.exe
for 64 bits machines:
C:\PROGRA~2\Android\android-sdk\SDK Manager.exe

Related

How do I create an Android App Bundle using Android Studio, command line (first steps from Android instructions don't work, not fully explained)?

Hello and thanks for helping me solve my problem! I ask for an easier way, as I am trying to figure it out without success in this tutorial https://developer.android.com/guide/app-bundle. So far, I only worked with the Google Play Console itself, did not create an application in a third-party service. I first tried to download the Android App Bundle using Android Studio as described in this article https://medium.com/androiddevelopers/building-your-first-app-bundle-bbcd228bf631, but the first step describes pressing buttons that are not on Android Studio Panel "In Android Studio, select“ Build => Generate Signed Bundle / APK ”and follow the dialog." I do not see the options I need in the Android Studio panel (I attach a screenshot)enter image description here
, where do I need to click to create an Android App Bundle? Then I tried to create the Android App Bundle from this tutorial using the command line https://developer.android.com/studio/build/building-cmdline, I installed Grable manually as described in this tutorial https://docs.gradle.org/current/userguide/installation.html#installation unpacked and configured the system environment, as well as installed and unpacked JDK 17 for Windows/x64 (also on disk C but in a different non-Grable folder), but verifying the Grable installation when typing gradle -v in Windows PowerShell throws an error, and these instructions https://docs.gradle.org/current/userguide/troubleshooting.html#sec:troubleshooting_installation does not offer a solution what is displayed in my Windows PowerShell enter image description here
(The sentence highlighted in red from the screenshot in English looks like this "grable: The name grable is not recognized as the name of a cmdlet, function, script file or executable program. Check the spelling of the name, as well as the presence and correctness of the path, and then try again."), and when I enter gradle -v into the command line, it says "Grable is not an internal or external command, an executable program or a batch file.", I face the same problem if I enter into command line ./gradlew bundleRelease as suggested in this tutorial https://medium.com/androiddevelopers/building-your-first-app-bundle-bbcd228bf631. I'm stumped, what am I doing wrong, and what method is easier for me to create an Android App Bundle? Thanks again for the help in solving my problem and I apologize in advance if I have provided little information necessary to solve my problem.

Getting Flutter doctor to work

How do I get flutter doctor on my Windows 10 laptop to work, please?
I followed the guidelines here,
Used git to clone the flutter repository,
git clone -b alpha https://github.com/flutter/flutter.git,
Tried adding "C:\Users\<user>\flutter\bin" to my path in the Control Panel
and then in an Admin Powershell, tried executing flutter doctor.
At first, it just hung.
After googling for help, I tried deleting the contents of the
C:\Users\<user>\flutter\bin\cache folder and re-executing flutter doctor but to no avail.
Then, I tried deleting all of flutter and cloning again but flutter doctor just hung again but with, Updating flutter tool.
Tried a few different Googled PATH-adding ideas (that seems to be a complex and disputed area.)
Got a new message: Waiting for another flutter command to release the startuplock
The latest state is that flutter doctor still just hangs but without any message.
I suspect the problem lies in the new Path not being properly recognised (in the registers??)
Can anyone help please?
Well, the issue is not clear enough, but this might be solution, if your flutter doctor is stuck, it might be due to Background Intelligent Transfer Service is disabled, in order to check for yourself, do the following:
Click on the start menu, and then start typing services.
Launch the services and look for Background Intelligent Transfer Service and make sure it is running.
At this stage I believe you will find it disabled for some reason, just right click on it and go to properties and start the service, also change the startup type to automatic.
I can not think of other reasons that might prevent flutter doctor to run for the first time on a Windows machine other than that honestly.
I know this question is a little bit old. Here is a solution that worked for me. Run the Command Prompt as an admin solved the issue for me.
For Windows user check to see if the unzipped flutter folder is read only. (i.e right click the folder then properties then in the attributes section untick the readonly property then apply this change to the folder along with the sub-folders then ok and thats it. Worked for me.
Some errors I got and how I fixed it:
(ERROR 1):
[flutter] flutter doctor -v 'crumb' is not recognized as an internal or external command, operable program or batch file.
Error: Unable to find git in your PATH. exit code 1
(Fix) - Go to flutter installation folder and inside flutter/bin edit the flutter.bat file using a text editor and remove the line (20) that says:
IF EXIST "%mingit_path%" SET PATH=%PATH%;%mingit_path%
The code should look like this on those lines:
REM If available, add location of bundled mingit to PATH
SET mingit_path=%FLUTTER_ROOT%\bin\mingit\cmd
Save and Run flutter doctor and everything should work fine.
(ERROR 2):
flutter doctor takes too long
(Fix) - I downloaded the previous version of the sdk it worked like a charm.
(ERROR 3):
Android sdkmanager not found. Update to the latest Android SDK and ensure that the cmdline-tools are installed to resolve this.
(Fix):
Open Android Studio
Tools Menu, SDK Manager
In the window that comes up there are inner panels, choose SDK Tools panel
Tick Android SDK Command-line Tools
Choose Apply button near the bottom of the window
This worked.
(ERROR 4):
The term 'flutter' is not recognized as the name of a cmdlet, function, script file, or operable program.
(Fix) - Put the correct part in the env variables. I had put D:\flutter instead of D:\flutter\bin. That worked.
I got a solution that worked for me
initially i had downloaded the 2.2.5 SDK which gave the forever run error so i went back and downloaded the previous version ie 2.2.2 it worked like a charm
The Flutter SDK is installed in a protected folder and may not function correctly. Please move the SDK to a location that is user-writable without Administration permissions and restart.

Invalid Configuration Location

The configuration area at '/home/shuvro/android-sdk-linux/eclipse/configuration' is not writable. Please choose a writable location using the '-configuration' command line option
I am facing this error while trying to launch eclipse. How can I fix it? I have another question- How can I completely uninstall the Eclipse ADT bundle?
You can set the correct rights for this folder, as I suggest it is not owned by your user.
On the other hand you can launch your eclipse with the '-configuration' parameter as suggested in the errormessage. Using this parameter you can use any folder on your system where you are able to write.
I cme across this somewhere else on the web. This solved my issue instantly:
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Desktop" /t REG_SZ /d "%USERPROFILE%\Desktop" /f
Had the same issue on my Windows machine.
My C: drive was corrupted. It used to show error 0x80070570.
Its very easy to solve on windows, just right click the drive > properties > tools tab > under error checking click on the check button (give admin permissions) and reboot the system when asked.
I had the same problem using Eclipse and ADT on Windows. The solution was quite simple but hard to detect:
I ran the ADT update from within Eclipse and this downloaded several new Android system images to <ADT install Folder>\sdk\system-images More than 4 GB in total. This consumed all the free disk space and thus on next launch ADT could not write any more to <ADT install Folder>...
Not directly related to the question but still close enough to maybe be some help to others with the same problem...
There was not enough space left, once i cleared some memory and started eclipse successfully.

Getting an error when trying to build the CubicPilot sample from the Unity Google Play plugin

i just watched this video about the Google Play Games plugin for Unity, and readed about how to set it up here.
But i get this error when i try to build the CubicPilot sample:
Error building Player: Win32Exception: ApplicationName='C:\Program Files (x86)\Java\jre7\bin\javac.exe', CommandLine='-bootclasspath "C:/Users/Danny/Desktop/adt-bundle-windows-x86_64-20131030/sdk/platforms/android-19\android.jar" -d
I've followed all the steps to set it up but i was not really sure about the step called:
"Additional instructions on building for Android on Windows" (Im using windows 7)
My computer had no JAVA_HOME enviroment variable, so i tried to create one and set the path to: C:\Program Files (x86)\Java\jre7 (I had no idea what i was doing, but it didn't work)
The instructions said that i had to set it to:
C:\Program Files\Java\jdk1.7.0_45.
However, there were no jdk1.7.0_45, so i just set it to the jre7 which was the only folder.
And i also didn't understand the "Add the Java SDK's bin folder to your PATH environment variable".
I hope someone can help me with the issue.
Thanks in advance.
How to change the path environment variable: http://www.computerhope.com/issues/ch000549.htm
I never experienced this error on unity before, but i got some issues like that programming for google app engine and android apps.
So, try download the jdk and use it instead of the jre. it has more features for developers, many of my problems (in another environments) were solved when I passed to use the jdk.

Waiting for HOME ('android.process.acore') to be launched

I tried working the Hello World application and the emulator freezes after it flashes the Android start screen. The home page is not shown. The last display on the console is
Waiting for HOME ('android.process.acore') to be launched...
I tried reinstalling Eclipse and Android again. It still did not work. Also the console does not show any errors. The log cat has the following errors:
06-18 20:39:11.543: ERROR/flash_image(544): can't find recovery partition
06-18 20:39:11.843: ERROR/vold(538): Error opening switch name path '/sys/class/switch/test2' (No such file or directory)
06-18 20:39:11.843: ERROR/vold(538): Error bootstrapping switch '/sys/class/switch/test2' (m)
06-18 20:39:11.843: ERROR/vold(538): Error opening switch name path '/sys/class/switch/test' (No such file or directory)
06-18 20:39:11.843: ERROR/vold(538): Error bootstrapping switch '/sys/class/switch/test' (m)
06-18 20:46:31.842: ERROR/MemoryHeapBase(578): error opening /dev/pmem: No such file or directory
06-18 20:46:31.892: ERROR/SurfaceFlinger(578): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
06-18 20:46:32.313: ERROR/GLLogger(578): couldn't load library (Cannot find library)
06-18 20:46:33.634: ERROR/GLLogger(578): couldn't load library (Cannot find library)
The solution which worked for me is, when you get the message:
Waiting for HOME ('android.process.acore') to be launched...
Wait for few seconds and then right click on the project and click run as Android application once again.
I faced the same problem. However, it worked after i went to Project->Clean...
Don't know why it happened though.
Hope this helps
I get this problem all the time and have lost many hours of potential productivity and education while I try to fix it. The only thing that works for me is the combination of three other good answers:
Project -> Clean
Delete all the AVDs and create new ones
If an attempt to run still hangs too long on 'Waiting for HOME' (over two minutes) or the emulator keeps rebooting every minute or so, try Run as Android App several times, choosing the same existing emulator instance (I always choose runs manually).
It's odd that no one has a clue why this problem comes up, what causes it or what is going on internally. The only clue I can supply is that DDMS shows a few lines like "Class not found for preloading: libcore.base.CollectionUtils" during the 'Waiting for HOME' pause.
What worked for me was to delete the AVD from the AVD manager and create a new one. Then go to
Run >Run Configurations, select the target tab and choose the new AVD.
Following steps worked for me:
1. Goto Project -> Clean.
2. Delete your previous AVD and create a new one.
This problem occurs because while creating the AVD manager in the "Create new Android virtual device(AVD)" dialog window ,"Snapshot" was marked as "Enabled" by me.
Solution:
Create a new AVD manager with the "Enabled" checkbox not checked and then try running the project with the newly created AVD manager as "Target" , the problem will not occur anymore
I solved this issue by creating a new virtual device and launching it from the AVD manager. The device takes a few minutes to start, you just have to wait. Then you can run your application on the already started device.
Options:
Click on the HOME Button on the Emulator. Wait for may be 2
seconds....
This always works for me!!!
or
Go with Shreya's suggestion (one with most suggestions and edited by
Gray).
I had only 12 Mb for the SD Card in the AVD device.
Increasing it to 2 Gb solved the issue.
SOLUTION:
Run the emulator from the command line:
sdk/tools> ./emulator-x86 -avd <DeviceName> -partition-size 1024 -gpu on
Then I launched the app from the command line as well (using built-in Cordova/PhoneGap tools):
myapp/cordova> ./run
BACKGROUND
I believe this is some sort of hardware compatibility issue. I came across this problem when following the PhoneGap 2.4.0 Getting Started Instructions. I followed their advice to install the Intel Hardware Accelerated Execution Manager, and I think this is the source of my trouble. Eclipse uses the emulator64-x86 program (in the sdk/tools folder) to launch the emulator. I could not find any way inside of Eclipse to change this but I found by following the "Tips & Tricks" section of the Intel HAXM web page that I could get the emulator to run successfully from the command line by using the emulator-x86 program instead. I'm not sure why the emulator64-x86 program doesn't work on my system. I confirmed at the Apple website that I do have a 64-bit processor.
My system:
OSX 10.6.8
2x2.26 GHx Quad-core Intel Xeon
6 GB RAM
ADT v21.1.0-569685
Eclipse 3.8.0
My AVD:
Device: Nexus One
Target: Android 4.2.2 - API Level 17
CPU: Intel Atom (x86)
RAM: 512
Internal Storage: 256
SD Card: 128
I created a new device. Deleted the previous one.
None of these solutions worked for me. Instead, what worked was to go to a command line tool (or terminal in Mac), CD into the SDK/platform-tools directory, and then run this:
adb kill-server
then run this:
adb start-server
After I did this everything worked again. Why? Who knows.
On my MAC the path to the platform-tools folder was $HOME/Installations/adt-bundle-mac-x86_64-20130522/sdk/platform-tools
It will probably be somewhere else on your machine.
I also found this page that presents some helpful steps:
http://android.okhelp.cz/android-emulator-wont-run-application-started-from-eclipse/
What worked for me was enabling the checkbox "Use Host GPU" when creating or editing the AVD (Android Virtual Device). This checkbox was not enabled by default.
It worked for me when I selected 'Use Host GPU' option under 'Emulation Options:'.
You can find the option under Edit window of the virtual device.
I increased the virtual device SD card size from 500MB to 2GiB, the problem solved.
Following steps worked for me: 1. Goto Project -> Clean. 2. Delete your previous AVD and create a new one.
I noticed this is an old post. However I just ran into the same problem and found a solution. A) Make sure you have the CPU/ABI is atom
B)Ram is 2048
C)VM Heap is 256
D)Internal Storage is 200
E)Make sure to check the Use Host GPU
F)Device is Nexus 5 (My personal choice)
G)Android 4.4.2 API Level 19