错误为Android与PhoneGap的/科尔多瓦建设时,在Mac OS X 10.9小牛队在执行命令“蚁族” [英] Error executing command 'ant' on Mac OS X 10.9 Mavericks when building for Android with PhoneGap/Cordova

查看:113
本文介绍了错误为Android与PhoneGap的/科尔多瓦建设时,在Mac OS X 10.9小牛队在执行命令“蚁族”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天,我试过的PhoneGap /科尔多瓦是 Mac OS X的小牛。建筑为iOS去就好了,但建设的Andr​​oid也不是没有一些猜测。

我通过Android SDK管理器安装的Andr​​oid 4.2.2(我不得不使用旧版本的 API V17 ,因为它不是用较新的兼容),增加了 PATH环境变量 作为SDK的平台工具工具,我想我已经准备好通过运行以下命令起飞:

  PhoneGap的运行Android
 

不过,我得到了以下错误:

  [PhoneGap的]检测Android SDK中的环境...
[PhoneGap的],用当地的环境
[PhoneGap的]加入Android平台...
 [错误]创建的Andr​​oid子项目的过程中发生错误。错误:在执行命令蚁族,确保你已经安装了蚂蚁,并添加到您的路径  

解决方案

被证明是真实的Apache Ant是不是在Mac OS X小牛队的路走的错误信息。

防弹解决方案:

  1. 下载并在终端执行以下命令安装自制软件:

      

    红宝石-e$(卷曲-fsSL <一href="https://raw.githubusercontent.com/Homebrew/install/master/install">https://raw.githubusercontent.com/Homebrew/install/master/install)"

  2. 通过自制软件执行安装Apache Ant

      

    酿造安装蚂蚁

运行的PhoneGap构建再次,它应该成功编译和安装Android应用程序。

Today I tried PhoneGap/Cordova with Mac OS X Mavericks. Building for iOS went just fine, but building for Android wasn't without some guesswork.

I installed Android 4.2.2 via the Android SDK Manager (I had to use the older API v17 since it wasn't compatible with a newer one), added the PATH environment variables for the SDK's platform-tools and tools and thought I was ready to take off by running the command:

phonegap run android

Nevertheless, I got the following error:

[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] adding the Android platform...
[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.

解决方案

The error message proved to be true as Apache Ant isn't in the path of Mac OS X Mavericks anymore.

Bulletproof solution:

  1. Download and install Homebrew by executing following command in terminal:

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  2. 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.

这篇关于错误为Android与PhoneGap的/科尔多瓦建设时,在Mac OS X 10.9小牛队在执行命令“蚁族”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆