I know what you're thinking. No, it's not any of the common errors you will see. I'm working on a Macbook, FYI. I am working with cordova/phonegap/ionic/angularjs/mongodb/nodejs for the first time and as I'm starting a new project I get this error:
MacbookThrone:hello neema$ sudo cordova platform add android
Creating android project...
/usr/local/lib/node_modules/cordova/node_modules/q/q.js:126
throw e;
^
Error: An error occured during creation of android sub-project.
/Users/neema/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:126
throw e;
^
Error: The command "android" failed. Make sure you have the latest Android SDK installed, and the "android" command (inside the tools/ folder) is added to your path.
at /Users/neema/.cordova/lib/android/cordova/3.3.0/bin/lib/check_reqs.js:85:29
at _rejected (/Users/neema/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:808:24)
and it just goes on and on like that. I read that one solution might be to run this:
MacbookThrone:hello neema$ phonegap build android
but that just threw this error:
MacbookThrone:hello neema$ phonegap build android
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] adding the Android platform...
[error] An error occured during creation of android sub-project.
/Users/neema/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:126
throw e;
^
Error: The command "android" failed. Make sure you have the latest Android SDK installed, and the "android" command (inside the tools/ folder) is added to your path.
at /Users/neema/.cordova/lib/android/cordova/3.3.0/bin/lib/check_reqs.js:85:29
at _rejected (/Users/neema/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:808:24)
at /Users/neema/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:834:30
at Promise.when (/Users/neema/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:1079:31)
at Promise.promise.promiseDispatch (/Users/neema/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:752:41)
at /Users/neema/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:574:44
at flush (/Users/neema/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:415:13)
I really have no idea what to do. Can anyone provide any insight? I've found these solutions but I cannot figure out how to get going with them...
Getting error when adding Android to Phonegap project
Phonegap 3 doesn't work with Android Studio
EDIT<<<< This solution might work! I'm going to try it and let you know > http://docs.phonegap.com/en/2.8.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android
I simply needed to add the correct path to my .bash_profile file. It was confusing at first, but now I got it.