invalid command line parameter when android execution - android-emulator

When I click the run as android application it shows the following error:
[2011-05-20 10:32:45 - Emulator] invalid command-line parameter: on.
[2011-05-20 10:32:45 - Emulator] Hint: use '#foo' to launch a virtual device named 'foo'.
[2011-05-20 10:32:45 - Emulator] please use -help for more information

This is most probably due to a space in the path. As Revision 12 is giving this error for everyone. Mine is Revision 12 in Eclipse Indigo Classic.
Please move your android-sdk folder to somewhere so that there doesn't contain any space in the path.
Or, try from command line.

Use below steps -
Right click Project -> Run As -> Run Configure -> Target
Scroll Down
Additional emulator command line option, type
-http-proxy http://10.1.1.10:8080
Restart ur emulator, it will work, and it is working for me too

Related

i am facing this issue while debugging it on emulator

problem was found with the configuration of task ':app:processDebugResources' (type 'LinkApplicationAndroidResourcesTask').
In plugin 'com.android.internal.version-check' type 'com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask' property 'androidJarInput.androidJar' specifies file 'C:\Users\NISHANT\AppData\Local\Android\sdk\platforms\android-31\android.jar' which doesn't exist.
Reason: An input file was expected to be present but it doesn't exist.
Solution 1: Try downloading android 31 from the Settings -> Appearance & Behavior -> System Settings -> Android SDK -> select SDK Platforms and check Android 12.0 and click apply and let it download and install and then try restarting Android studio and/or the laptop/PC if required and then try again.
Solution 2: If Solution 1 doesn't work out, try downloading and adding API 31 android.jar to the designated address: (C:\Users\NISHANT\AppData\Local\Android\sdk\platforms\android-31)

Jupyter extension for VSCode on Linux throws error when doing anything Jupyter related

After installing code-oss on Manjaro Linux along with the Jupyter extension for code and jupyter-notebooks itself, the extension seems to error when I try to do anything Jupyter related inside code. If I try to create a new notebook from the command pallete, it pops up a dialog saying this:
Command 'Jupyter: Create New Jupyter Notebook' resulted in an error (command 'jupyter.createnewnotebook' not found)
Code then tells me that the extension activation failed and to open the chrome developer console for more information. This is what the chrome console then says:
extension activation failed Error: Extension 'ms-toolsai.jupyter' CANNOT use API proposal: notebookEditor. Its package.json#enabledApiProposals-property declares: but NOT notebookEditor. The missing proposal MUST be added and you must start in extension development mode or use the following command line switch: --enable-proposed-api ms-toolsai.jupyter
Initial Pop-up error
Chrome Console error
You can solve that problem by inserting"enable-proposed-api": ["ms-toolsai.jupyter"] in the start settings of vs code. So press CTRL+ALT+P -> "Preference: Configure Runtime Arguments" then insert the upper line. After that restart vscode.
Had the same problem and found out this is happening because of the open source version of code - OSS. It does not have the proper config in the product.json.
The accepted solution to add to Runtime Arguments unfortunately didn't work on Arch.
Easiest solution for me was to install code-features from AUR.
You can find more info on arch wiki site
Or directly on microsoft docs regarding oss code issues.
The solution to add "enable-proposed-api": ["ms-toolsai.jupyter"] to the runtime of vscode didn't work for me on Arch linux. But when I started vscode from the command line using the argument "--enable-proposed-api ms-toolsai.jupyter" the problem was solved. So I created a custom desktop launcher for this:
Fist, copy the desktop launcher to your applications folder
$ cp /usr/share/applications/code-oss.desktop ~/.local/share/applications/.
Then edit the new file:
$ nano ~/.local/share/applications/code-oss.desktop
Now add "--enable-proposed-api ms-toolsai.jupyter" to both of the Exec lines like so:
[Desktop Entry]
Name=Code - OSS
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/bin/code-oss --enable-proposed-api ms-toolsai.jupyter --unity-launch %F
Icon=com.visualstudio.code.oss
Type=Application
StartupNotify=false
StartupWMClass=Code
Categories=TextEditor;Development;IDE;
MimeType=text/plain;application/x-code-oss-workspace;
Actions=new-empty-window;
Keywords=vscode;
[Desktop Action new-empty-window]
Name=New Empty Window
Exec=/usr/bin/code-oss --enable-proposed-api ms-toolsai.jupyter --new-window %F
Icon=com.visualstudio.code.oss
I restarted my computer and the problem was solved.

cannot open Andoid emulator on VS Code

I am using the github.com/DiemasMichiels/emulator extension for VS Code. Whenever I try to open the emulator, I get these notifications. what is the problem and what should I do about it?
Something went wrong fetching you Android emulators! Make sure your path is correct. Try running this command in your terminal: "false\emulator" -list-avds
source: Android iOS emulator (extension)
Error: spawn C:\WINDOWS\system32\cmd.exe ENOENT
source: Android iOS emulator (extension)
Make sure your Windows path is set correctly! Example: C:\Users\Me\AppData\Local\Android\Sdk\emulator
source: Android iOS emulator (extension)
If you are using Windows remove .exe from the path
New path should be: :\Users\HUNG\AppData\Local\Android\Sdk\emulator
See this GitHub issue ticket in the DiemasMichiels/emulator extension's repo: Something went wrong fetching you Android emulators #14
Quoting from some of the comments in the discussion thread there:
https://github.com/DiemasMichiels/emulator/issues/14#issuecomment-464050318 :
This is related to my update with #13. Point it to the directory instead of the actual executable file instead and I think it should work just fine! - antonholmberg
https://github.com/DiemasMichiels/emulator/issues/14#issuecomment-464254880 :
In previous version (0.0.7) it works with:
"emulator.emulatorPath": "%ANDROID_HOME%/emulator/emulator.exe"
But now (1.0.0): Only works when i use absolute path like:
"emulator.emulatorPath": "C:\Users\RodrigoSaka\AppData\Local\Android\Sdk\emulator" - RodrigoSaka
Given those comments, you should update your settings.json with something like this, where you give the absolute path to the directory containing the emulator executable instead of the path to the executable:
"emulator.emulatorPath": "C:\\Users\\{username}\\AppData\\Local\\Android\\Sdk\\emulator"

"ERROR : No emulator images (avds) found" running ionic on osx 10.10

This is the full error message I got after running ionic emulate android
*running cordova emulate android
Running command: /Users/DeadLift/Documents/ionic/myApp/hooks/after_prepare/010_add_platform_class.js /Users/DeadLift/Documents/ionic/myApp
add to body class: platform-android
Running command: /Users/DeadLift/Documents/ionic/myApp/platforms/android/cordova/run --emulator
ANDROID_HOME=/usr/local/Cellar/android-sdk/24.1.2
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home
/Users/DeadLift/Documents/ionic/myApp/platforms/android/cordova /node_modules/q/q.js:126
throw e;
^
ERROR : No emulator images (avds) found.
1. Download desired System Image by running: /usr/local/Cellar/android-sdk/24.1.2/bin/android sdk
2. Create an AVD by running: /usr/local/Cellar/android-sdk/24.1.2/bin/android avd
HINT: For a faster emulator, use an Intel System Image and install the HAXM device driver
Error: /Users/DeadLift/Documents/ionic/myApp/platforms/android/cordova/run: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23) *emphasized text*
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)*
I follow all the above by creating an avd and it give me the same message again.
Thanks.
Vikas's answer is pretty spot on, however (sometimes) just running android avd won't work, which is what I found out after hours of trying to get it working.
When ever I ran android avd in my terminal it would give me the following error:
zsh: command not found: android
This is because I needed to add the Android SDK paths for the platform-tools and tools to my zshrc file (you might be running bash or something else on your terminal).
Simple fix was to add these files to my zshrc PATH environment, You can do this too by using your favourite text editor and depending on what shell you're using.
This link: http://docs.phonegap.com/en/2.8.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android helped me out a hell of a lot getting this fixed.
So I used subl ~/.zshrc (because sublime is my text editor and i've setup symlinks)
I Found my exports PATH and changed it to represent the following:
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/dev/.rbenv/versions/2.2.3/bin/ruby:/Users/dev/Library/Android/sdk/platform-tools:/Users/dev/Library/Android/sdk/tools:$PATH"
I then saved the file, closed down sublime and ran source ~/.zshrc in my terminal window, and now I can run android avd and it now opens the Android Virtual Device Manager with no problems.
A reminder your shell might be different to mine (i.e. not running with zsh)and your exports PATH might look different as well, but it's pretty easy to figure out, and the link above will also help if you get stuck.
Actually it is not able to find AVD (Android virtual device). You have to create one.
Type "android avd" from Command Promt to use the graphical manager to setup an emulator image to work with for running your app on. The graphical tool is fairly straight forward to use.

android ddms tool error

i got the error in ddms tools.
when i run the ddms in android sdk tools it shows"Failed to get the adb version": cannot run program adb;crate process error=2;the system cannot find the file specified".
Try add to the PATH variable the sdk tools path.
it should looks like 'C:\Program Files\Android\android-sdk-windows\platform-tools\' (don't forget the last backslash).