PhoneGap 3.0 Android build 命令执行失败:ant jar

PhoneGap 3.0 Android build 命令执行失败:ant jar

问题描述:

我使用 Node.js 安装了 PhoneGap 3.0 并配置了所有环境变量,以便 javac、java 和 ant 都能正常工作,但是当我创建基本应用程序并尝试为 Android 构建它时,我收到以下错误:

I installed PhoneGap 3.0 with Node.js and configured all the environment variables so that javac, java, and ant all work but when I do a basic app create and try to build it for Android, I get the following error:

创建android子项目时出错.为Android平台创建Cordova项目:Command failed to execute : ant jar

An error occurred during creation of android sub-project. Creating Cordova project for the Android platform: Command failed to execute : ant jar

有什么想法吗?

确保为您的 Android SDK 版本安装了 Android Build Tools.在 Android SDK 管理器的 Tools>Android SDK Build-tools 下,您应该会看到未安装适用于您的 SDK 版本的 Build 工具.

Make sure you have the Android Build Tools installed for your Android SDK version. In the Android SDK manager under Tools>Android SDK Build-tools you should see that the Build tools for your SDK version are not installed.

关于我如何发现这一点的详细信息:

Detail on how I uncovered this:

为了确定这是根本原因,我使用 -d 运行 Cordova 命令以获取详细信息:

To identify this as the root cause I ran the Cordova command with -d for verbosity:

cordova -d platform add android

此命令的输出显示错误:

The output of this command shows the error:

Running bin/create for platform "android" with command: ""C:\Users\---\.cordova\lib\android\cordova\3.1.0\bin\create"  "C:\Users\---\workspace_android\FleetView\platforms\android" "com.---.fleetview" "Fleet View"" (output to follow)

直接运行违规命令:

"C:\Users\---\.cordova\lib\android\cordova\3.1.0\bin\create"  "C:\Users\---\workspace_android\FleetView\platforms\android" "com.---.fleetview" "Fleet View"

产生这个输出:

BUILD FAILED
C:\tools\adt-bundle-windows-x86_64-20130219\sdk\tools\ant\build.xml:479: SDK does not have any Build Tools installed.

Total time: 1 second
Command failed to execute : ant jar

我使用的是 Windows 7.

I am on Windows 7.