ERROR: Unable to find ant.bat!

I’m trying to run a demo on my Android device. I just can’t set the ANT_HOME correctly. Editor keeps telling me it can’t find ant.bat. I’m new to Unreal. This is the first frustrating and meaningless problem. Please give a hint to solve this.
LogPlayLevel: ====2015/11/20 22:18:07====UPDATING BUILD CONFIGURATION FILES====================================================
LogPlayLevel: UEDeployAndroid.RunCommandLineProgramAndThrowOnError: Updating project.properties, local.properties, and build.xml…
LogPlayLevel: UEDeployAndroid.RunCommandLineProgramAndThrowOnError: Updating project.properties, local.properties, and build.xml…
LogPlayLevel: UEDeployAndroid.UpdateGameActivity:
LogPlayLevel: ==== Writing new GameActivity.java file to D:\Unreal\Projects\FifthAndroid\Intermediate/Android/APK\src\com\epicgames\ue4\GameActivity.java ====
LogPlayLevel: UEDeployAndroid.MakeApk:
LogPlayLevel: Copying new .so D:\Epic Games\4.10\Engine\Binaries\Android\UE4Game-armv7-es2.so file to jni folder…
LogPlayLevel: UEDeployAndroid.RunCommandLineProgramAndThrowOnError: Preparing native code for debugging…
LogPlayLevel: AndroidPluginLanguage.ProcessPluginNode:
LogPlayLevel: File D:\Epic Games\4.10/Engine/Source/ThirdParty/Oculus/LibOVRMobile/LibOVRMobile_062/VrApi/Libs/Android/armeabi-v7a/libvrapi.so copied to D:\Unreal\Projects\FifthAndroid\Intermediate/Android/APK/libs/armeabi-v7a/libvrapi.so
LogPlayLevel: AndroidPluginLanguage.ProcessPluginNode:
LogPlayLevel: File D:\Epic Games\4.10/Engine/Source/ThirdParty/Oculus/LibOVRMobile/LibOVRMobile_062/VrApi/Libs/Android/VrApi.jar copied to D:\Unreal\Projects\FifthAndroid\Intermediate/Android/APK/libs/VrApi.jar
LogPlayLevel: AndroidPluginLanguage.ProcessPluginNode:
LogPlayLevel: File D:\Epic Games\4.10/Engine/Source/ThirdParty/Oculus/LibOVRMobile/LibOVRMobile_062/1stParty/VrPlatform/libs/vrplatlib.jar copied to D:\Unreal\Projects\FifthAndroid\Intermediate/Android/APK/libs/vrplatlib.jar
LogPlayLevel: UEDeployAndroid.MakeApk:
LogPlayLevel: ====2015/11/20 22:18:14====PERFORMING FINAL APK PACKAGE OPERATION================================================
LogPlayLevel: BuildCommand.Execute: ERROR: BUILD FAILED
LogPlayLevel: Program.Main: ERROR: AutomationTool terminated with exception:
LogPlayLevel: Program.Main: ERROR: Exception in UnrealBuildTool: ERROR: Unable to find ant.bat (via %ANT_HOME% or %ANDROID_HOME%/…/eclipse/plugins/org.apache.ant*
LogPlayLevel: Stacktrace: 在 UnrealBuildTool.Android.UEDeployAndroid.GetAntPath()
LogPlayLevel: 在 UnrealBuildTool.Android.UEDeployAndroid.MakeApk(String ProjectName, String ProjectDirectory, String OutputPath, String EngineDirectory, Boolean bForDistribution, String CookFlavor, Boolean bMakeSeparateApks, Boolean bIncrementalPackage, Boolean bDisallowPackagingDataInApk)
LogPlayLevel: 在 UnrealBuildTool.Android.UEDeployAndroid.PrepForUATPackageOrDeploy(String ProjectName, String ProjectDirectory, String ExecutablePath, String EngineDirectory, Boolean bForDistribution, String CookFlavor, Boolean bIsDataDeploy)
LogPlayLevel: 在 AndroidPlatform.Package(ProjectParams Params, DeploymentContext SC, Int32 WorkingCL)
LogPlayLevel: 在 Project.Package(ProjectParams Params, Int32 WorkingCL)
LogPlayLevel: 在 BuildCookRun.DoBuildCookRun(ProjectParams Params)
LogPlayLevel: 在 BuildCommand.Execute()
LogPlayLevel: 在 AutomationTool.Automation.Execute(List1 CommandsToExecute, CaselessDictionary1 Commands)
LogPlayLevel: 在 AutomationTool.Automation.Process(String[] CommandLine)
LogPlayLevel: 在 AutomationTool.Program.MainProc(Object Param)
LogPlayLevel: 在 AutomationTool.InternalUtils.RunSingleInstance(Action`1 Main, Object Param)
LogPlayLevel: 在 AutomationTool.Program.Main()
LogPlayLevel: ProcessManager.KillAll: Trying to kill 0 spawned processes.
LogPlayLevel: Program.Main: AutomationTool exiting with ExitCode=Error_Unknown
LogPlayLevel: Domain_ProcessExit
LogPlayLevel: copying UAT log files…
LogPlayLevel: RunUAT.bat ERROR: AutomationTool was unable to run successfully.
LogPlayLevel: Completed Launch On Stage: Deploy Task, Time: 7.758571
LogPlayLevel: BUILD FAILED
PackagingResults:Error: 错误 Launch failed! Unknown Error
LogFileHelpers: Editor autosave (incl. sublevels) for ‘/Game/ThirdPersonBP/Maps/ThirdPersonExampleMap’ took 0.016

Hello Jieke -

In your Project Settings under Platforms >> Android SDK, have you setup the directories there to link to your Android Development information?

If you haven’t take a look at the Android Quick Start Guide found here:

Android Quick Start | Unreal Engine Documentation

Thank You

Eric Ketchum

Yes, of course. I’m using windows 10.
AndroidWorks is supposed to do all the jobs.
[link text][1]
Please help check the settings in these two images. Is there anything wrong ?

67519-qq图片20151121083641.png

Please help check the log file.

67520-qq20151121083508.png

I’m really blocked here. I need to break through this.

Hi Eric Ketchum,
The problem is resolved.
The root cause is that I failed to correctly set the “Location of ANT” in Project Settings>>Platform>>Android SDK>>SDKConfig.
I set it to D:\Android\NVPACK\apache-ant-1.8.2\bin as for cocos2d,
while it should be just D:\Android\NVPACK\apache-ant-1.8.2.
I finally found this out by downloading and debugging the source code. It’s so glad to see the demo running on my device, hah ha.

Thanks
Jieke