Download

Cannot Export from Unreal engine to Android

hi all.
i am getting this error. when i Launch to android in ue4. please help me ASAP

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: at UnrealBuildTool.Android.UEDeployAndroid.GetAntPath() in d:\Unreal Engine 4\UnrealEngine-release\Engine\Source\Programs\UnrealBuildTool\Android\UEDeployAndroid.cs:line 149
LogPlayLevel: at UnrealBuildTool.Android.UEDeployAndroid.MakeApk(String ProjectName, String ProjectDirectory, String OutputPath, String EngineDirectory, Boolean bForDistribution, String CookFlavor, Boolean bMakeSeparateApks, Boolean bIncrementalPackage, Boolean bDisallowPackagingDataInApk) in d:\Unreal Engine 4\UnrealEngine-release\Engine\Source\Programs\UnrealBuildTool\Android\UEDeployAndroid.cs:line 1002
LogPlayLevel: at UnrealBuildTool.Android.UEDeployAndroid.PrepForUATPackageOrDeploy(String ProjectName, String ProjectDirectory, String ExecutablePath, String EngineDirectory, Boolean bForDistribution, String CookFlavor, Boolean bIsDataDeploy) in d:\Unreal Engine 4\UnrealEngine-release\Engine\Source\Programs\UnrealBuildTool\Android\UEDeployAndroid.cs:line 1081
LogPlayLevel: at AndroidPlatform.Deploy(ProjectParams Params, DeploymentContext SC) in d:\Unreal Engine 4\UnrealEngine-release\Engine\Source\Programs\AutomationTool\Android\AndroidPlatform.Automation.cs:line 530
LogPlayLevel: at Project.Deploy(ProjectParams Params) in d:\Unreal Engine 4\UnrealEngine-release\Engine\Source\Programs\AutomationTool\Scripts\DeployCommand.Automation.cs:line 56
LogPlayLevel: at BuildCookRun.DoBuildCookRun(ProjectParams Params) in d:\Unreal Engine 4\UnrealEngine-release\Engine\Source\Programs\AutomationTool\Scripts\BuildCookRun.Automation.cs:line 256
LogPlayLevel: at BuildCommand.Execute() in d:\Unreal Engine 4\UnrealEngine-release\Engine\Source\Programs\AutomationTool\BuildCommand.cs:line 37
LogPlayLevel: at AutomationTool.Automation.Execute(List1 CommandsToExecute, CaselessDictionary1 Commands) in d:\Unreal Engine 4\UnrealEngine-release\Engine\Source\Programs\AutomationTool\Automation.cs:line 380
LogPlayLevel: at AutomationTool.Automation.Process(String] CommandLine) in d:\Unreal Engine 4\UnrealEngine-release\Engine\Source\Programs\AutomationTool\Automation.cs:line 352
LogPlayLevel: at AutomationTool.Program.MainProc(Object Param) in d:\Unreal Engine 4\UnrealEngine-release\Engine\Source\Programs\AutomationTool\Program.cs:line 168
LogPlayLevel: at AutomationTool.InternalUtils.RunSingleInstance(MainProc Main, Object Param) in d:\Unreal Engine 4\UnrealEngine-release\Engine\Source\Programs\AutomationTool\Utils.cs:line 705
LogPlayLevel: at AutomationTool.Program.Main() in d:\Unreal Engine 4\UnrealEngine-release\Engine\Source\Programs\AutomationTool\Program.cs:line 115
LogPlayLevel: Program.Main: ERROR: ERROR: Unable to find ant.bat (via %ANT_HOME% or %ANDROID_HOME%/…/eclipse/plugins/org.apache.ant*
LogPlayLevel: ProcessManager.KillAll: Trying to kill 0 spawned processes.
LogPlayLevel: Program.Main: AutomationTool exiting with ExitCode=1
LogPlayLevel: Domain_ProcessExit
LogPlayLevel: ProcessManager.KillAll: Trying to kill 0 spawned processes.
LogPlayLevel: AutomationToolLauncher exiting with ExitCode=1
LogPlayLevel: copying UAT log files…
LogPlayLevel: RunUAT.bat ERROR: AutomationTool was unable to run successfully.
LogPlayLevel: Completed Launch On Stage: Deploy Task, Time: 93.714514
LogPlayLevel: BUILD FAILED

Did you happen to see this guide?
https://docs.unrealengine.com/latest/INT/Platforms/Android/GettingStarted/1/index.html

The part you care about is installing the SDK. If you already have ant installed then you can look into this page:

The key line in your log is here:
LogPlayLevel: Program.Main: ERROR: ERROR: Unable to find ant.bat (via %ANT_HOME% or %ANDROID_HOME%/…/eclipse/plugins/org.apache.ant*

You need to have your environment variable specified correctly for ant… ANT_HOME is what you want

How to set ANT_HOME ? It’s already be added by AndroidWorks-1R1-windows.exe. It works when running ant with cmd. I really how I should do it now.

Hi Jieke,

Yes, ANT_HOME should be set for you by AndroidWorks installer and should be set to something like C:\NVPACK\apache-ant-1.8.2. The ant.bat is in the bin directory there.

Right-click on My Computer > Properties > Advanced > environment Variable