So I've been trying for a few days to add the android platform to my project but I keep getting this response in terminal. (Using OSX, Phonegap 3.3.0)
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/XerxesNoble/.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/XerxesNoble/.cordova/lib/android/cordova/3.3.0/bin/lib/check_reqs.js:85:29
at _rejected (/Users/XerxesNoble/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:808:24)
at /Users/XerxesNoble/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:834:30
at Promise.when (/Users/XerxesNoble/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:1079:31)
at Promise.promise.promiseDispatch (/Users/XerxesNoble/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:752:41)
at /Users/XerxesNoble/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:574:44
at flush (/Users/XerxesNoble/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:415:13)
at /usr/local/lib/node_modules/cordova/src/platform.js:244:30
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket.<anonymous> (child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
I've made sure to install the SDK from developer.android and I have set my .bash-profile $PATH to:
export PATH=${PATH}:Android/sdk/platform-tools:Android/sdk/tools
At this point I'm really not sure what else I can do to trouble shoot the problem.
Any help would be much appreciated!
This error because Android is not defined to your machine, this means that your paths are not right, so all you have to do is to update bash profile file with corresponding paths. I think that PATH=${PATH}:Android/sdk/platform-tools:Android/sdk/tools
is not right, it should be absolute path to these folders. something like:
export PATH=/Users/your_user/adt-bundle-mac-x86_64-20130522/sdk/tools/:/Users/your_user/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/:$PATH
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.