ionic emulate android not working - android

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

Related

Keep getting: Failed to install 'cordova-plugin-whitelist':Error: cmd: Command failed with exit code 1

I'm new to this and I just wanted to do the things in this Tutorial:
Installing Cordova & Android SDK on Windows 7, 8 & 10 to Develop Mobile app
At 7:36 it's shown that I have to type:cordova platform add android
I did it but I'm getting this:
Failed to install 'cordova-plugin-whitelist':Error: cmd: Command failed with exit code 1
at ChildProcess.whenDone (G:\Cordovatest\hello\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:829:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
Failed to restore plugin "cordova-plugin-whitelist" from config.xml. You might need to try adding it again. Error: Error: cmd: Command failed with exit code 1
Hope to get some help-
please do the following:
1) Add the environment variables, ANDROID_HOME and JAVA_HOME ( giving the path of the folder Android SDK and the one of JDK in the value).
2) In the System Variable PATH, add the path of the platform-tools the one of the Tools folder.
It will fix your error successfully.
Case Ionic Solution plugin fail whitelisterror
invoking the location of the java_home executable ie java.exe then recompiling
reason: the environment variables did not load at that time fail windows, because if they were well declare, Thanks

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'

cordova build error on ubuntu when trying to build from terminal

I am getting the following error when trying to build sencha app in terminal on ubuntu meachine..
edge#edge-HP:~/Desktop/Anupam2014/MobileAtSite_Aug23/cordova$ cordova build
Running command: /home/edge/Desktop/Anupam2014/MobileAtSite_Aug23/cordova/platforms/android/cordova/build
Buildfile: /home/edge/Desktop/Anupam2014/MobileAtSite_Aug23/cordova/platforms/android/build.xml
BUILD FAILED
/home/edge/Desktop/Anupam2014/MobileAtSite_Aug23/cordova/platforms/android/build.xml:90: Cannot find
/home/transnoesis/Downloads/adt-bundle-linux-x86_64-20130729/sdk/tools/ant/build.xml imported from
/home/edge/Desktop/Anupam2014/MobileAtSite_Aug23/cordova/platforms/android/build.xml
Total time: 0 seconds
Error code 1 for command: ant with args: debug,-
f,/home/edge/Desktop/Anupam2014/MobileAtSite_Aug23/cordova/platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: /home/edge/Desktop/Anupam2014/MobileAtSite_Aug23/cordova/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/lib/node_modules/cordova/src/superspawn.js:126:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
This looks path settings issue and is unable to find path to sdk & ant tools.
Currently I am on Windows and see how I've set paths on Windows, so you check and set yours accordingly on Ubuntu, hope will help you.
ANT_Home: C:\Program Files\apache-ant-1.9.4
Java_Home: C:\Program Files\Java\jdk1.7.0_60
ANDROID_HOME: C:\Android\AndroidSDK\sdk
path:.;C:\Program Files\nodejs\;%ANT_HOME%\bin;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools;

How to fix issue in appium using Ubuntu

I have worked on automation tool(Appium) in android using Ubuntu PC.I have written test case and run using TestNG in eclipse.Whenever I have run test case I have got the error i.e.
Failed to start an Appium session, err was: Error: zipAlignApk failed. Error: Command failed: /bin/sh: 1: -f: not found
info: Error: zipAlignApk failed. Error: Command failed: /bin/sh: 1: -f: not found
at /usr/lib/node_modules/appium/lib/devices/android/adb.js:461:19
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket.<anonymous> (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:465:12)
I am also converting build to zipAlign and using this command
zipalign -f -v 4 "/home/android/Desktop/app.apk" "/home/android/Desktop/app1.apk"
Please suggest me how to fix this issue
Seems like this is related to your zipAlignApk install location. You might just need to make a symlink in your /bin/sh directory. Don't think this is related to appium
It would seem that the command you are using is -f, not zipalign as you intended. The error message shows that your toolchain (specifically on line 461 of adb.js) ran a shell script/command. The shell (/bin/sh) started and tried to locate the executable it was told to run: -f. It could not find an executable file named -f in its $PATH, so it failed.
Since -f is supposed to be the first argument you pass to zipalign I would suspect that however it is that you put that command in your tools is incorrect and the command itself is missing when the shell is invoked.

Categories

Resources