Error executing command 'ant' on Mac OS X 10.9 Mavericks when building for Android with PhoneGap/Cordova
The error message proved to be true as Apache Ant isn't in the path of Mac OS X Mavericks anymore.
Bulletproof solution:
Download and install Homebrew by executing following command in terminal:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install Apache Ant via Homebrew by executing
brew install ant
Run the PhoneGap build again and it should successfully compile and install your Android app.
Error executing command 'ant', Creating Project using cordova 3.3 through CLI
I faced the same issue. here is the exact solution.
Control Panel\System and Security\System\
click advanced system settings
click Environment variables
In system variables :
ANT_HOME: C:\ant
path: %ANT_HOME%\bin;
This will work..
phonegap run android: command failed to execute: ant jar - on Windows
ANT tools could not find tools.jar in JRE lib directory.
In order to solve your issue just :
Copy tools.jar from Java/JDK1.7.0_45/lib directory to Java/JRE7/lib directory and
Run the command cordova platform add android
again.
Hope this helps you.
Cordova command-line build fails in /tmp on Mac
I finally discovered the answer using the cordova
command-line tools. Cordova has a -d
flag which is way more verbose than PhoneGap's -V
flag. The linker was failing with a bunch of errors like
duplicate symbol _OBJC_METACLASS_$_CDVTimer in:
/private/tmp/buildtest-ios/platforms/ios/build/emulator/libCordova.a(CDVTimer.o)
/tmp/buildtest-ios/platforms/ios/build/emulator/libCordova.a(CDVTimer.o)
Note that /tmp
on Mac is a symlink to /private/tmp
, so these are pointing to the same file. No wonder they're duplicate symbols! So why is it trying to include the same file twice?
I tried creating a new test project in an empty folder /private/my-new-tmp2/buildtest-ios
. Building it failed with the same error. So apparently something is weird with Cordova's iOS projects and the Ld
linker in the /private
directory on Mac OS X 10.9, and I'm the only person who's ever tried this. (As I said, building for Android works fine.)
In case someone else ever runs into the same problem, the solution is to build the project in /Users/me/some/directory
rather than anywhere in /tmp
or /private
. Problem solved.
Phonegap/cordova add Android Platform on Mac not recognized as core cordova platform
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.
Cannot get ant installed properly for phonegap using eclipse and windows 8
I was following Phonegap's platform guide for Android and I kept getting the above error. The directions on the guide were a little confusing. I went back to check what I had installed and found some configuration errors.
Under Environment Variables, I created new ANDROID_HOME, ANT_HOME, and JAVA_HOME system variables with the respective physical file paths as the value. This part may be overkill, but I was trying to cover my bases and I have noticed no significant issues with it so far.
Example:
Variable: ANDROID_HOME Value: C:\Development\adt-bundle\sdk
Variable: ANT_HOME Value: C:\Development\apache-ant-1.9.2
Variable: JAVA_HOME Value: C:\Program Files\Java\jdk1.6.0_45
Next I added the following values to the Path system variable in Environment Variables:
%JAVA_HOME%\bin;%ANT_HOME%\bin;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools;
After making these changes and continuing to follow the guide, everything worked like it should. It boiled down to not having my system variables set to the correct physical file path.
Related Topics
Otp (Token) Should Be Automatically Read from the Message
Don't Collapse Toolbar When Recyclerview Fits the Screen
Running Emulator After Building Android from Source
How to Change App Name Per Gradle Build Type
Okhttp Response Callbacks on the Main Thread
Change Expandable Indicator in Expandablelistview
How to Implement Google Maps Search by Address in Android
Download and Extract Zip File in Android
Android Studio Image Asset Launcher Icon Background Color
Why a Viewmodel Factory Is Needed in Android
Adding Custom Font to Theme in Android
Android Audiorecord Supported Sampling Rates
How to Stop Scrolling in a Gallery Widget
Making a Linearlayout Act Like an Button
Failure [Install_Failed_Already_Exists] When I Tried to Update My Application