Sport
Sport

Reputation: 8945

Getting error when adding Android to Phonegap project

I am new in phonegap. I am getting error when I add android in phonegap. I have used this steps to solve this error but I am still getting this error:

/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/ss/.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/ss/.cordova/lib/android/cordova/3.3.0/bin/lib/check_reqs.js:85:29 
at _rejected (/Users/ss/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:808:24) 
at /Users/ss/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:834:30 
at Promise.when (/Users/ss/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:1079:31) 
at Promise.promise.promiseDispatch (/Users/sss/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:752:41) 
at /Users/ss/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:574:44 
at flush (/Users/ss/.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)

Upvotes: 1

Views: 4328

Answers (3)

K00kykelly
K00kykelly

Reputation: 31

For OSX your path needs to include /Users/yourusername

their example: /Development/adt-bundle/sdk/platform-tools needs to be: /Users/yourusername/Development/adt-bundle/sdk/platform-tools

check your path with echo $PATH (use caps, it's case sensitive!)

Upvotes: 0

square
square

Reputation: 162

There is step-by-step instructions on the PhoneGap Doc'.you can use this to solve the issue link

Upvotes: 0

jcesarmobile
jcesarmobile

Reputation: 53301

You have to add /pathToAndroidFolder/sdk/platform-tools and /pathToAndroidFolder/sdk/tools to your $PATH

steps for Mac OSX: edit your .bash_profile using nano or any other editor

nano ~/.bash_profile

add this line

export PATH=${PATH}:/Users/ss/Documents/Software/adt-bundle-mac-x86_64-20130729/sdk/tools:/Users/ss/Documents/Software/adt-bundle-mac-x86_64-20130729/sdk/platform-tools

open a new terminal window to make it work, or use this command to make it work on the curren terminal window:

source ~/.bash_profile

Upvotes: 1

Related Questions