I am getting this same error while trying to add platform Android
to simple HelloWorld application created using CLI Cordova
on Windows 8.
Path vaiables has been set for
%ANT%,%ANT_HOME%,%ANDROID_HOME%
PATH Also contains
%ANDROID_HOME%platform-tools and %ANDROID_HOME%ools in the listings.
PS E:Android ProjectsHelloWorld> cordova platforms add android
Creating android project...
C:UsersMIGHTY.cordovalibandroidcordova3.4.0in
ode_modulesqq.js:126
throw e;
^
Error: An error occurred while listing Android targets
at C:UsersMIGHTY.cordovalibandroidcordova3.4.0inlibcheck_reqs.js:87:29
at _rejected (C:UsersMIGHTY.cordovalibandroidcordova3.4.0in
ode_modulesqq.js:808:24)
at C:UsersMIGHTY.cordovalibandroidcordova3.4.0in
ode_modulesqq.js:834:30
at Promise.when (C:UsersMIGHTY.cordovalibandroidcordova3.4.0in
ode_modulesqq.js:1079:31)
at Promise.promise.promiseDispatch (C:UsersMIGHTY.cordovalibandroidcordova3.4.0in
ode_modulesqq.js:752:41)
at C:UsersMIGHTY.cordovalibandroidcordova3.4.0in
ode_modulesqq.js:574:44
at flush (C:UsersMIGHTY.cordovalibandroidcordova3.4.0in
ode_modulesqq.js:108:17)
at process._tickCallback (node.js:415:13)
Error: C:UsersMIGHTY.cordovalibandroidcordova3.4.0increate.bat: Command failed with exit code 8
at ChildProcess.whenDone (C:UsersMIGHTYAppDataRoaming
pm
ode_modulescordovasrcsuperspawn.js:126: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)
Simillar error is being raised while trying to create the same on iOS also.
PS E:Android ProjectsHelloWorld> cordova platforms add ios
Creating ios project...
Error: C:UsersMIGHTY.cordovalibioscordova3.4.1increate: Command failed with exit code ENOENT
at ChildProcess.whenDone (C:UsersMIGHTYAppDataRoaming
pm
ode_modulescordovasrcsuperspawn.js:126:23)
at ChildProcess.EventEmitter.emit (events.js:95:17)
at Process.ChildProcess._handle.onexit (child_process.js:795:12)
Solved:
Thank you, the issue with Android has been resolved.
The path variable pointing to this android was wrong. I had used %ANDROID_HOME% as variable and scaled the same to path variables %ANDROID_HOME%SDKTOOLS. This method doesn't work. Experimentally resolved by directly pointing to the Tools and Platform Tools.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…