Difficulty getting ionic emulate android to work - android

I have been successfully emulating my ionic project with ios but am unable to get it to come up on the Android emulator on my Mac. I get the following error from ionic:
/Users/billnoble/documents/cues/code/current/Cues-App/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Target 'WQVGA400' not found, unable to run project
Error: /Users/billnoble/documents/cues/code/current/Cues-App/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:139:23)
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 have the Android SDK installed and skins installed in the library/android/sdk/platforms/android-22/skins directory. I have checked that the WQVGA400 skin is in there.
The ionic command I am issuing is:
ionic emulate android --target="WQVGA400"
Am I missing a step?

Related

Cordova CLI can't find Android SDK using Windows 10

I have set my Environment Variables, yet I continue to get the following error:
[Error: Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable.]
ERROR building one of the platforms: Error: cmd: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 2
at ChildProcess.whenDone (C:\Users\oneilj\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:139:23)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:818:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
I have uninstalled Android Studio and all the SDKs, and even un-installed nodeJS and cordova. After re-installing everything I still get the error.
I found this while waiting for an answer. The fix was from another user's question and answer:
Download tools_r25.2.3-windows.zip from Android Downloads.
Extracted zip on desktop
Replaced C:\Users\username\AppData\Local\Android\sdk\tools with extracted sub-folder tools/
In project folder:
$ cordova platforms remove android
$ cordova platforms add android

Cordova building error on Windows

I am having a tremendous problem with cordova. For some reason, the command cordova build gives me the following error and I cannot figure out why. I try to do a simple andoid application on Windows 7.
C:\Users\User\Documents\Cordova\workshop>cordova build
Running command: cmd "/s /c "C:\Users\User\Documents\Cordova\workshop\platforms\
android\cordova\build.bat""
[Error: Please install Android target: "android-22".
Hint: Open the SDK manager by running: C:\Users\User\AppData\Local\Android\sdk\t
ools\android.BAT
You will require:
1. "SDK Platform" for android-22
2. "Android SDK Platform-tools (latest)
3. "Android SDK Build-tools" (latest)]
ERROR building one of the platforms: Error: cmd: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 2
at ChildProcess.whenDone (C:\Users\User\AppData\Roaming\npm\node_modules\cor
dova\node_modules\cordova-lib\src\cordova\superspawn.js:139:23)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:818:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
C:\Users\User\Documents\Cordova\workshop>
Do you have any advice how to solve this problem?

Cordova - android error when building

This is my first experience in cordova. I created the helloworld project and installed the android platform correctly. When I tried to build the project by cordova build android, it shows this error message.
Running command: /home/menaka/hello/platforms/android/cordova/build
[Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.]
ERROR building one of the platforms: Error: /home/menaka/hello/platforms/android/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /home/menaka/hello/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
But I have successfully set the ANDROID_HOME variable and PATH.
menaka#menaka-X550LC:~/hello$ echo $ANDROID_HOME
/Extra/Softwares/Android/Sdk/
So, what would be the reason for this?

Cordova build issue in ubuntu

I was following the tutorials # http://www.gaggl.com/2014/04/apache-cordova-development-environment-install-on-ubuntu/
Cordova build is failing with message:
:~/projects/Hello$ sudo cordova build
Running command: /home/skn/projects/Hello/platforms/android/cordova/build
[Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.]
ERROR building one of the platforms: Error: /home/skn/projects/Hello/platforms/android/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /home/skn/projects/Hello/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)
I have included the android in the path variable also.
skn#bangre:~/projects/Hello$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/bin/java:/usr/bin/ant:.:/home/skn/android-sdk-linux/tools:/home/skn/android-sdk-linux/platform-tools
From screenshot below you can see the sdk is installed
Also I have the following check which is passing.
skn#bangre:~/.cordova/lib/npm_cache/cordova-android/3.7.1/package/bin$ ./android_sdk_version
21
skn#bangre:~/.cordova/lib/npm_cache/cordova-android/3.7.1/package/bin$ ./check_reqs
Looks like your environment fully supports cordova-android development!
Please help me point out the issue.
yes turns out the cordova node.js scripts assumes the android sdk directory name as 'android-sdk' , for ubuntu when we unzip we get 'android-linux-sdk'

ionic emulate android not working

I am trying to create a blank project using ionic framework. But I'm getting the following error when I run the ionic emulate android command.
Error executing "adb devices": /bin/sh: 1: adb: not found
Error: /home/username/todo/platforms/android/cordova/run: Command failed with exit code 8
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
I also have added android sdk path to .bashrc file.
export ANDROID_HOME="$HOME/username/android/eclipse/adt-bundle/sdk/tools"
export ANDROID_PLATFORM_TOOLS="$HOME/username/eclipse/adt-bundle/sdk/platform-tools"
export PATH="$ANDROID_HOME:$ANDROID_PLATFORM_TOOLS:$PATH"
I have also install the eclipse adt bundle for 64 bits. any kind of help would be appreciated.
Error executing "adb devices": /bin/sh: 1: adb: not found
Do you have adb in your path? If not, put it. It comes with android sdk

Categories

Resources