Home:ALL Converter>Error while adding the Android platform to a cordova project

Error while adding the Android platform to a cordova project

Ask Time:2014-08-28T23:33:49         Author:Christian

Json Formatter

I started a fresh Cordova project via:

cordova create project com.pro.ject Project

When I added:

cordova platform add android

I got the error:

Downloading cordova library for android...
Download complete
Creating android project...

C:\Users\myself\.cordova\lib\android\cordova\3.5.1\bin\node_modules\q\q.
js:126
                    throw e;
                          ^
Error: An error occurred while listing Android targets
    at C:\Users\myself\.cordova\lib\android\cordova\3.5.1\bin\lib\check_
reqs.js:87:29
    at _rejected (C:\Users\myself\.cordova\lib\android\cordova\3.5.1\bin
\node_modules\q\q.js:808:24)
    at C:\Users\myself\.cordova\lib\android\cordova\3.5.1\bin\node_modul
es\q\q.js:834:30
    at Promise.when (C:\Users\myself\.cordova\lib\android\cordova\3.5.1\
bin\node_modules\q\q.js:1079:31)
    at Promise.promise.promiseDispatch (C:\Users\myself\.cordova\lib\and
roid\cordova\3.5.1\bin\node_modules\q\q.js:752:41)
    at C:\Users\myself\.cordova\lib\android\cordova\3.5.1\bin\node_modul
es\q\q.js:574:44
    at flush (C:\Users\myself\.cordova\lib\android\cordova\3.5.1\bin\nod
e_modules\q\q.js:108:17)
    at process._tickCallback (node.js:415:13)
Error: cmd: Command failed with exit code 8
    at ChildProcess.whenDone (C:\Users\myself\AppData\Roaming\npm\node_m
odules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135: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

At the same time Eclipse can successfully create phonegap project and compile them towards android but the cordova.exe doesn't recognise the projects created by Eclipse as Cordova projects.

Author:Christian,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/25552697/error-while-adding-the-android-platform-to-a-cordova-project
user2378562 :

Add both \n\n\\android-sdks\\tools \n\nand \n\n\\android-sdks\\platform-tools \n\nto your path and it works",
2014-09-11T12:55:02
yy