错误为Android与PhoneGap的/科尔多瓦建设时,在Mac OS X 10.9小牛队在执行命令“蚁族”科尔、小牛队、命令、错误

2023-09-12 02:36:03 作者:无心看风景

今天,我试过的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小牛队的路走的错误信息。

防弹解决方案:

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

  

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

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

  

酿造安装蚂蚁

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

基于android跟phonegap环境搭建

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:

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.