Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
566 views
in Technique[技术] by (71.8m points)

cordova - Error on adding platform in Ionic Framework on Windows

I get the following error while adding the Android platform. I had checked my ant -version and it outputted it correctly. Also, I noticed when it created the myApp folder node_modules wasn't fetched with it. Beneath is output from my console:

Adding platform android
Creating android project...

C:Usersuser.cordovalibandroidcordova3.5.0in
ode_modulesqq.js:126
                    throw e;
                          ^
Error: An error occurred while listing Android targets
    at C:Usersuser.cordovalibandroidcordova3.5.0inlibcheck_reqs.js
:87:29
    at _rejected (C:Usersuser.cordovalibandroidcordova3.5.0in
ode_m
odulesqq.js:808:24)
    at C:Usersuser.cordovalibandroidcordova3.5.0in
ode_modulesqq.
js:834:30
    at Promise.when (C:Usersuser.cordovalibandroidcordova3.5.0in
od
e_modulesqq.js:1079:31)
    at Promise.promise.promiseDispatch (C:UsersRiliwan.cordovalibandroidco
rdova3.5.0in
ode_modulesqq.js:752:41)
    at C:Usersuser.cordovalibandroidcordova3.5.0in
ode_modulesqq.
js:574:44
    at flush (C:Usersuser.cordovalibandroidcordova3.5.0in
ode_modul
esqq.js:108:17)
    at process._tickCallback (node.js:419:13)
Error: C:Usersuser.cordovalibandroidcordova3.5.0increate.bat: Comma
nd failed with exit code 8
    at ChildProcess.whenDone (C:UsersRiliwanAppDataRoaming
pm
ode_modules
cordova
ode_modulescordova-libsrccordovasuperspawn.js:131:23)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:753:16)
    at Process.ChildProcess._handle.onexit (child_process.js:820:5)
Unable to add platform android. Please see console for more info.
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I'm using Ubuntu 14.04 and fixed it by setting these paths to the O.S. Path:

export ANDROID_HOME=/home/coutinho/android-sdk 
export ANDROID_TOOLS=/home/coutinho/android-sdk/tools/  
export ANDROID_PLATFORM_TOOLS=/home/coutinho/android-sdk/platform-tools/

PATH=$PATH:$ANDROID_HOME:$ANDROID_TOOLS:$ANDROID_PLATFORM_TOOLS:.

Then it worked fine.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...