Ubuntu throw error when run "ionic platform android"


#1

Hi all,

I’m new to ionic and phonegap. And I need some advice on how to make it work in my Ububtu. Thanks

I follow the instruction here --> http://ionicframework.com/docs/guide/installation.html
and when I run ionic platform android, I got the following error

$> ionic platform android
Running platform task…
Adding platform android
Creating android project…

/home/ryu/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:126
throw e;
^
Error: An error occurred while listing Android targets
at /home/ryu/.cordova/lib/android/cordova/3.4.0/bin/lib/check_reqs.js:87:29
at _rejected (/home/ryu/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:808:24)
at /home/ryu/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:834:30
at Promise.when (/home/ryu/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:1079:31)
at Promise.promise.promiseDispatch (/home/ryu/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:752:41)
at /home/ryu/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:574:44
at flush (/home/ryu/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:415:13)
Error: /home/ryu/.cordova/lib/android/cordova/3.4.0/bin/create: Command failed with exit code 8
at ChildProcess.whenDone (/usr/lib/node_modules/cordova/src/superspawn.js:112: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)
Unable to add platform android. Please see console for more info.


#2

Ok, solved. I just need to install all the dependencies required by ionic framework … which is Android SDK :smile:


#3

Hey iroy2000, I am getting the exact same error. I have downloaded the android sdk, but I’m not sure how to let ionic know where it is… I tried setting the path variable in home/user/.profile but it doesn’t seem to see it.

What was your solution?

Thank you :blush:


#4

Any luck with this??


#5

@miir & @rushme1986 : Are you also on Ubuntu? If not, what platforms? My suggestion would be to go through the Cordova platform guides and the Android install guides for making sure you have Android configured properly on your machine. It’s a bit off topic for Ionic.