Help! Cannot add any platform


#1

Help! I just installed ionic, and I cannot add either platforms. I’m on Windows 7.

I have another question: Can I use the phonegap developer app to serve and test my app?

Thank you! Here are my errors:

C:\Users\Oindril Dutta\My Documents\Github\myApp>ionic platform add android
add platform android
Creating android project…

C:\Users\Oindril Dutta.cordova\lib\android\cordova\3.5.0\bin\node_modules\q\q.js:126
throw e;
^
Error: ERROR : executing command ‘ant’, make sure you have ant installed and added to your path.
at C:\Users\Oindril Dutta.cordova\lib\android\cordova\3.5.0\bin\lib\check_reqs.js:47:27
at ChildProcess.exithandler (child_process.js:651:7)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:755:16)
at Socket. (child_process.js:968:11)
at Socket.emit (events.js:95:17)
at Pipe.close (net.js:465:12)
Error: cmd: Command failed with exit code 8
at ChildProcess.whenDone (C:\Users\Oindril Dutta\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:755:16)
at Process.ChildProcess._handle.onexit (child_process.js:822:5)
Unable to add platform android.

C:\Users\Oindril Dutta\My Documents\Github\myApp>ionic platform add ios
add platform ios
Creating ios project…
’“C:\Users\Oindril Dutta.cordova\lib\ios\cordova\3.5.0\bin\create”’ is not recognized as an internal or external command,
operable program or batch file.
Error: cmd: Command failed with exit code 1
at ChildProcess.whenDone (C:\Users\Oindril Dutta\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:755:16)
at Process.ChildProcess._handle.onexit (child_process.js:822:5)
Unable to add platform ios.


#2

OK! I installed ant (the error for android) and I’m unable to add iOS on windows. Sucks.

But after getting ant, I’m getting this:

C:\Users\Oindril Dutta\My Documents\github\myApp>ionic platform add android
add platform android
Creating android project…

C:\Users\Oindril Dutta.cordova\lib\android\cordova\3.5.0\bin\node_modules\q\q.js:126
throw e;
^
Error: An error occurred while listing Android targets
at C:\Users\Oindril Dutta.cordova\lib\android\cordova\3.5.0\bin\lib\check_reqs.js:87:29
at _rejected (C:\Users\Oindril Dutta.cordova\lib\android\cordova\3.5.0\bin\node_modules\q\q.js:808:24)
at C:\Users\Oindril Dutta.cordova\lib\android\cordova\3.5.0\bin\node_modules\q\q.js:834:30
at Promise.when (C:\Users\Oindril Dutta.cordova\lib\android\cordova\3.5.0\bin\node_modules\q\q.js:1079:31)
at Promise.promise.promiseDispatch (C:\Users\Oindril Dutta.cordova\lib\android\cordova\3.5.0\bin\node_modules\q\q.js:752:41)
at C:\Users\Oindril Dutta.cordova\lib\android\cordova\3.5.0\bin\node_modules\q\q.js:574:44
at flush (C:\Users\Oindril Dutta.cordova\lib\android\cordova\3.5.0\bin\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:419:13)
Error: cmd: Command failed with exit code 8
at ChildProcess.whenDone (C:\Users\Oindril Dutta\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:755:16)
at Process.ChildProcess._handle.onexit (child_process.js:822:5)

Help!


#3

Hmm you should check out our video to make sure you didn’t miss anything.

http://learn.ionicframework.com/videos/windows-android/

Also, update the ionic cli, there were a few issue with windows.

the latest version should be 1.1.5


#4

For Android, this it what worked for me:

  1. Open SDK manager
  2. Uninstall all SDK and build tool higher than version 19
  3. Try running “ionic build android” and reinstalling SDK and build tool versions from 19 onwards until the build succeeds