0
votes

I downloaded the android SDK and extracted it to a directory.

I have set the system variables

ANDROID_HOME : C:\Users\Aditya Sethi\Downloads\adt-bundle-windows-x86-20140321\adt-bundle-windows-x86-20140321\sdk

path : existing path;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools

now when I am trying to add platform with cordova platform add android it fails

Error is : $ cordova -d platform add android cordova library for "android" already exists. No need to download. Continuing. Checking if platform "android" passes minimum requirements... Creating android project... Running command: "C:\Users\Aditya Sethi.cordova\lib\android\cordova\3.4.0\bin\c reate.bat" --cli "c:\Users\Aditya Sethi\Documents\Project\conference\platforms\a ndroid" com.phonegap.helloworld HelloWorld 'C:\Users\Aditya' is not recognized as an internal or external command, operable program or batch file. Command finished with error code 1: C:\Users\Aditya Sethi.cordova\lib\android\c ordova\3.4.0\bin\create.bat --cli,c:\Users\Aditya Sethi\Documents\Project\confer ence\platforms\android,com.phonegap.helloworld,HelloWorld Error: C:\Users\Aditya Sethi.cordova\lib\android\cordova\3.4.0\bin\create.bat: Command failed with exit code 1 at ChildProcess.whenDone (c:\Users\Aditya Sethi\AppData\Roaming\npm\node_mod ules\cordova\src\superspawn.js:126:23) at ChildProcess.EventEmitter.emit (events.js:98:17) at maybeClose (child_process.js:735:16) at Process.ChildProcess._handle.onexit (child_process.js:802:5)

Any idea how to fix this?

1

1 Answers

1
votes

Seems to be a whitespace related issue. Try not to have whitespace's in your path eg. Aditya<space>Sethi or use shortened DOS names like ADITYA~1

eg. your env variable can be:

ANDROID_HOME : C:\Users\ADITYA~1\Downloads\adt-bundle-windows-x86-20140321\adt-bundle-windows-x86-20140321\sdk