简体   繁体   中英

Error creating android project Ionic platform android

I am trying to build android app using cordova and ionic framework but whenever I try to select the platform I get the following error message, I also set the environment variables for android, ant and java

$ cordova platform add android
Creating android project...

C:\Users\Darpan\node_modules\q\q.js:126
                throw e;
                      ^
Error: Failed to run "android". Make sure you have the latest Android SDK instal
led, and that the "android" command (inside the tools/ folder) is added to your
PATH.

at C:\Users\Darpan\.cordova\lib\npm_cache\cordova-android\3.6.3\package\bin\
lib\check_reqs.js:43:27
at ChildProcess.exithandler (child_process.js:652:7)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Socket.<anonymous> (child_process.js:969:11)
at Socket.emit (events.js:95:17)
at Pipe.close (net.js:465:12)
Error: C:\Users\Darpan\.cordova\lib\npm_cache\cordova-android\3.6.3\package\bin\
create.bat: Command failed with exit code 8
at ChildProcess.whenDone (c:\Users\Darpan\AppData\Roaming\npm\node_modules\c
ordova\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)

I dont understand what is the issue.

I also set the environment variables for android

Perhaps try running 'which android' to make sure you have properly set your path? The android executable is located in pathToSDK/sdk/tools.

It might also be worth verifying the tools are installed by running the Android SDK Manager.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM