0

I have an issue with setting up an Android Project on Mac OS. with the command:

$cordova platform add /path/to/androidSDK/android

I've got the error message:

[Error: Platform "/path/to/androidSDK/android" not recognized as core cordova platform.]

Does anyone have the same Issue ? How can I fix that ?

latest Android SDK version (downloaded today).

Phonegap version: 3.1.0-0.15.0

OSX 10.9 Mavericks

oneandonlycore
  • 480
  • 6
  • 23

2 Answers2

5

To install the cordova command-line tool, follow these steps:

First of all go through the Cordova Document

For Cordova command-line tools to work, you need to include the SDK's tools and platform-tools directories in your PATH environment. On Mac, you can use a text editor to create or modify the ~/.bash_profile file, adding a line such as the following, depending on where the SDK installs:

export PATH=${PATH}:/Development/adt-bundle/sdk/platform-tools:/Development/adt-bundle/sdk/tools

Next Steps:

Download and install Node.js from Here. Following installation, you should be able to invoke node or npm on your command line.

Install the cordova utility. In Unix(Mac), prefixing the additional sudo command may be necessary to install development utilities in otherwise restricted directories:

 For Mac $ sudo npm install -g cordova

once successful installation of cordova is done ,now you can create your application

across all the platforms.

Create the Cordova Application

Go to the directory where you maintain your source code, and run a command such as the following:

    $cordova create hello com.example.hello CordovaDemo

hello is the directory where you want to create your application

com.example.hello is the package name

CordovaDemo is the name of the Application

Once Successful creation of your project, some file will be created inside the directory i.e hello

Add Platforms

All subsequent commands need to be run within the project's directory, or any subdirectories within its scope:

  $ cd hello

Now you need to specify a set of target platforms, Supported OS for Mac

$ cordova platform add android

plz tell me if you are still having problem.

Hope this will help you.

Amit Gupta
  • 8,914
  • 1
  • 25
  • 33
  • @oneandonlycore i though you have configured Android correctly.. Apache ant is not requited at the moment. – Amit Gupta Oct 25 '13 at 10:57
  • well, I've tried to add the platform after the export of the android path and I got this error: bash-3.2$ cordova platform add android [Error: An error occured during creation of android sub-project. ERROR : executing command 'ant', make sure you have ant installed and added to your path. ] – oneandonlycore Oct 25 '13 at 11:06
  • @oneandonlycore for me i did't get this error. If it helps you than can you please upvote and accept my answer? – Amit Gupta Oct 25 '13 at 11:08
  • just for others who got the ant error: http://stackoverflow.com/a/19495611/2586612 – oneandonlycore Oct 25 '13 at 11:13
  • @AmitGupta I still have the problem. I hope you can help me. Everything works except `cordova platform add android`. If i use `open ~/.bash_profile` then the file is empty (apart from the line I added), can this be correct? – clankill3r Jul 24 '14 at 12:19
0

this is documentation Phonegab docs

and my .bash_profile:

export PATH=${PATH}:$HOME/Development/adt-bundle-mac-x86_64-20140321/sdk/platform-tools:$HOME/Development/adt-bundle-mac-x86_64-20140321/sdk/tools

visit the solution here

I hope this helps you

Community
  • 1
  • 1
ikhsannetwork
  • 103
  • 2
  • 6