The Android Command does not work in Windows 8 CLI?


#1

I am on Windows 8 and following through how to install and use Cordova with Ionic Framework on Windows 8.1. I followed through the video here: http://learn.ionicframework.com/videos/windows-android/. I am stuck at 5:58 of the video where the SDK Manager is suppose to come up when I type ‘android’ in the command line, but it says it’s unrecognizable command. I made sure my file directory=ies are exact. What else am I missing? How do I fix this problem?

PATH
C:\Users\Jaime\AppData\Roaming\npm; C:\Program Files\Java\jdk1.8.0_25\bin; C:\Development\AndroidSDK\sdk\platform-tools; C:\Development\AndroidSDK\sdk\tools; C:\Development\ApacheAnt\bin; C:\Program Files\nodejs

Thanks!


#2

hey i did it different,
i created new system vars

like:
name:
ANDROID_SDK_HOME
value:
C:\Development\AndroidSDK\sdk

and i insert to the PATH
%ANDROID_SDK_HOME%\tools;%ANDROID_SDK_HOME%\platform-tools;

i did it with all the vars:
JAVA, ANDROID, ANT

AND REMEMBER thet the folder “progrem files” need to be:

On a 64-bit machine running in 64-bit mode:

%programfiles% ==> C:\Program Files
%programfiles(x86)% ==> C:\Program Files (x86)

On a 64-bit machine running in 32-bit (WOW64) mode:

%programfiles% ==> C:\Program Files (x86)
%programfiles(x86)% ==> C:\Program Files (x86)

try this and tell us if its fixed :smile:

itamar


#3

Can you be more specific as to what do I put in the JAVA, ANDROID, ANT files? Do I put in System Vars or User Vars as there are two separate ones. Thank you. Also, I’d like to notify you of this problem I’m having, assuming it’s still not working:

C:\Users\Jaime\myapp>ionic platform add android
npm http GET https://registry.npmjs.org/cordova-android/3.6.4
npm http 200 https://registry.npmjs.org/cordova-android/3.6.4
npm http GET https://registry.npmjs.org/cordova-android/-/cordova-android-3.6.4.
tgz
npm http 200 https://registry.npmjs.org/cordova-android/-/cordova-android-3.6.4.
tgz
Creating android project…

C:\Users\Jaime.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\node_mod
ules\q\q.js:126
throw e;
^
Error: ANDROID_HOME is not set and “android” command not in your PATH. You must
fulfill at least one of these conditions.
at C:\Users\Jaime.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\l
ib\check_reqs.js:159:19
at _fulfilled (C:\Users\Jaime.cordova\lib\npm_cache\cordova-android\3.6.4\p
ackage\bin\node_modules\q\q.js:798:54)
at self.promiseDispatch.done (C:\Users\Jaime.cordova\lib\npm_cache\cordova-
android\3.6.4\package\bin\node_modules\q\q.js:827:30)
at Promise.promise.promiseDispatch (C:\Users\Jaime.cordova\lib\npm_cache\co
rdova-android\3.6.4\package\bin\node_modules\q\q.js:760:13)
at C:\Users\Jaime.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\n
ode_modules\q\q.js:821:14
at flush (C:\Users\Jaime.cordova\lib\npm_cache\cordova-android\3.6.4\packag
e\bin\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:415:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)
at node.js:902:3
Error: C:\Users\Jaime.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\c
reate.bat: Command failed with exit code 8
at ChildProcess.whenDone (C:\Users\Jaime\AppData\Roaming\npm\node_modules\co
rdova\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)


#4

hey,

you need to add 3 new system vars:

  1. name: ANDROID , value: C:\Development\AndroidSDK\sdk
    2.name : JAVA , value: C:\Progra~1\Java\jdk1.8.0_25
    3.name: ANT, value: C:\Development\ApacheAnt

and then you need to edit your system PATH var and add this:

%ANDROID%\tools;%ANDROID%\platform-tools;%JAVA%\bin;%ANT%\bin;

thats will work

tell me how its go :smile:


#5

Still the same problem. Are you sure this is right? 2. name : JAVA , value: C:\Progra~1\Java\jdk1.8.0_25
I copied it as exact into three new system vars with the system PATH var and still doesn’t work.

Here’s what I have so far:
USER variables:
name: PATH
variable:
C:\Users\Jaime\AppData\Roaming\npm; C:\Program
Files\Java\jdk1.8.0_25\bin;
C:\Development\AndroidSDK\sdk\platform-tools;
C:\Development\AndroidSDK\sdk\tools;
C:\Development\AndroidSDK\sdk\build-tools; C:\Development\ApacheAnt\bin;
C:\Program Files\nodejs;
%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools

SYSTEM variables:
name: ANDROID
variable: C:\Development\AndroidSDK\sdk

name: ANT
variable: C:\Development\ApacheAnt

name: JAVA
variable: C:\Program Files\Java\jdk1.8.0_25

UPDATE:
I finally got it working. I had to set the system variable to ANDROID_HOME and download a few more packages from the SDK Manager and it worked. Thanks for the help though. Really appreciate it.