Utkarsh
Utkarsh

Reputation: 103

cordova platform add android not working

cordova platfrom add android not working on Windows7. Its giving following error.

C:\Users\user\cordova_projects\myapp>cordova platforms add android

npm http GET https://registry.npmjs.org/cordova-android/3.6.4

npm http 304 https://registry.npmjs.org/cordova-android/3.6.4

Creating android project...

Error: C:\Users\user.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\cr

eate.bat: Command failed with exit code -1073741819

at ChildProcess.whenDone (C:\Users\user\AppData\Roaming\npm\node_modules\cor

dova\node_modules\cordova-lib\src\cordova\superspawn.js:135: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)

Upvotes: 0

Views: 1974

Answers (2)

AAhad
AAhad

Reputation: 2845

This looks a path setting issue, I am too working on Window 7 and had similar issues initially when i had wrong path set. Plus there are no# of questions on SO where due to path have similar issues reported ...see this & this and this.

Here is how I set paths, so you check and set yours accordingly, 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

and path variable references to three things:

path:.;C:\Program Files\nodejs\;%ANT_HOME%\bin;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools;

Upvotes: 1

oenpelli
oenpelli

Reputation: 3567

You should try clearing the cache:

npm cache clean

Upvotes: 0

Related Questions