运行时出现此错误


  离子构建Android


错误截图



C:\Users\Ahmed\IonicProjects\first\firstIonicApp>ionic build android
Running command: "C:\Program Files\nodejs\node.exe"      C:\Users\Ahmed\IonicProjects
\first\firstIonicApp\hooks\after_prepare\010_add_platform_class.js   C:\Users\Ahme
d\IonicProjects\first\firstIonicApp
Running command: "C:\Program Files\nodejs\node.exe" C:\Users\Ahmed\IonicProjects
\first\firstIonicApp\hooks\after_prepare\020_remove_sass_from_platforms.js C:\Us
ers\Ahmed\IonicProjects\first\firstIonicApp
Running command: C:\Users\Ahmed\IonicProjects\first\firstIonicApp\platforms\andr
oid\cordova\build.bat
ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.
Built the following apk(s):


我也想知道与yeoman引导离子项目更好吗?
我已经看过一些教程。

最佳答案

基于此link,您需要执行以下操作:


下载并安装Ant
将ANT_HOME环境变量设置为Ant的安装位置(右键单击>>属性>>高级>>环境变量...)
将%ANT_HOME%\ bin添加到您的PATH
打开命令行并键入“ ant -version”,然后检查其是否正常运行。

10-08 18:25