Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is PhoneGap/Cordova not adding android platform?

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!

like image 575
xno Avatar asked Dec 24 '13 06:12

xno


People also ask

Does Cordova support Android 12?

We have integrated the Android 12 SplashScreen API including the compatibility library into the core of the Cordova-Android platform to provide support for Android API 22+.

Is Cordova still supported?

Supported platforms As of version 9, Apache Cordova currently supports development for the operating systems Apple iOS, Google Android, Windows 8.1, Windows Phone 8.1 , Windows 10 and Electron (software framework) (which in turn runs on Windows, Linux and macOS).


1 Answers

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
like image 128
Hazem Hagrass Avatar answered Sep 23 '22 16:09

Hazem Hagrass