Cordova Platform Add Android Error

Hello!

I’ve followed the installation steps for Windows, listed here:
http://ionicframework.com/docs/guide/installation.html

My setup looks like this:

Cordova CLI: 6.2.0
Ionic Framework Version: 1.3.1
Ionic CLI Version: 1.7.15
Ionic App Lib Version: 0.7.2
OS: Windows 7
Node Version: v4.4.5

These are my environment variables:

ANDROID_HOME: C:\Users\USERNAME\AppData\Local\Android\sdk
JAVA_HOME: C:\Program Files\Java\jdk1.8.0_92
Path: ;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\pufi\AppData\Roaming\npm;C:\Program Files\nodejs;%JAVA_HOME%\bin;C:\apache-ant-1.9.7\bin;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools

Everything is fine until I try to add Android platform with the cordova platform add android command, which gives me this error:

$ cordova platform add android
Adding android project...
/c/Users/pufi/AppData/Roaming/npm/cordova: line 14:  2664 Illegal instruction     node "$basedir/node_modules/cordova/bin/cordova" "$@"

I’ve reinstalled everything multiple times, but the error persists. cordova platform add browser command works fine. Any solution?

I’ve managed to solve it, after upgrading my Windows to Service Pack 1, the error is gone

2 Likes

@neti if you dont mind can you send your source code

it mainly help for develop my skills