Program.Main: ERROR: ERROR: cmd.exe failed with args /c "C:/apache-ant-1.8.2/bin/ant.bat" debug

I cannot Build my android game i get this error every time
Program.Main: ERROR: ERROR: cmd.exe failed with args /c “C:/apache-ant-1.8.2/bin/ant.bat” debug

i have scoured the inter for similar if not same problems, and have tried every fix or solution that i’ve come across and still no luck.

i have done my best to solve the problem myself so any input or advice would be greatly appreciated

I have been able to build previously

I am using binary

I have my sdk installed and tadp

I have all the file paths set up correctly

I have the bin folders in place of file paths

My project name doesn’t have brackets in it

I have java 8 installed

The project is about 95% blueprints with a small amount of Code

i checked to make sure my ant.bat and android.bat are present and they are

I have setup my environment variables

i can build other games just not this one, i have tried cloning the game into a different folder, did not work, i have tried migrating the game into a new project and it also did not work

here is my error log [Android Build Fail][2]

and screenshots of sdk file paths and installation

These are the main areas where all the errors appear

Buildfile: C:\Users\owner\Documents\Unreal Projects\IMAFUCKINGIDIOT\Intermediate\Android\APK\build.xml
====8/24/2015 8:00:04 AM====UPDATING BUILD CONFIGURATION FILES====================================================
UEDeployAndroid.RunCommandLineProgramAndThrowOnError: Updating project.properties, local.properties, and build.xml…
UEDeployAndroid.RunCommandLineProgramAndThrowOnError: Updating project.properties, local.properties, and build.xml…
UEDeployAndroid.MakeApk:
====8/24/2015 8:00:13 AM====PREPARING NATIVE CODE=================================================================
UEDeployAndroid.RunCommandLineProgramAndThrowOnError: Preparing native code for debugging…
UEDeployAndroid.MakeApk:
====8/24/2015 8:00:20 AM====PERFORMING FINAL APK PACKAGE OPERATION================================================
UEDeployAndroid.RunCommandLineProgramAndThrowOnError: Making .apk with Ant… (note: it’s safe to ignore javac obsolete warnings)

and…

BUILD FAILED
C:\NVPACK\android-sdk-windows\tools\ant\build.xml:716: The following error occurred while executing this line:
C:\NVPACK\android-sdk-windows\tools\ant\build.xml:730: Compile failed; see the compiler error output for details.

Total time: 12 seconds
BuildCommand.Execute: ERROR: BUILD FAILED
Program.Main: ERROR: AutomationTool terminated with exception:
Program.Main: ERROR: Exception in UnrealBuildTool: ERROR: cmd.exe failed with args /c “C:/apache-ant-1.8.2/bin/ant.bat” debug
Stacktrace: at UnrealBuildTool.Android.UEDeployAndroid.RunCommandLineProgramAndThrowOnError(String WorkingDirectory, String Command, String Params, String OverrideDesc, Boolean bUseShellExecute)
at UnrealBuildTool.Android.UEDeployAndroid.MakeApk(String ProjectName, String ProjectDirectory, String OutputPath, String EngineDirectory, Boolean bForDistribution, String CookFlavor, Boolean bMakeSeparateApks, Boolean bIncrementalPackage, Boolean bDisallowPackagingDataInApk)
at UnrealBuildTool.Android.UEDeployAndroid.PrepForUATPackageOrDeploy(String ProjectName, String ProjectDirectory, String ExecutablePath, String EngineDirectory, Boolean bForDistribution, String CookFlavor, Boolean bIsDataDeploy)
at AndroidPlatform.Deploy(ProjectParams Params, DeploymentContext SC)
at Project.Deploy(ProjectParams Params)
at BuildCookRun.DoBuildCookRun(ProjectParams Params)
at BuildCommand.Execute()
at AutomationTool.Automation.Execute(List1 CommandsToExecute, CaselessDictionary1 Commands)
at AutomationTool.Automation.Process(String[] CommandLine)
at AutomationTool.Program.MainProc(Object Param)
at AutomationTool.InternalUtils.RunSingleInstance(MainProc Main, Object Param)
at AutomationTool.Program.Main()
Program.Main: ERROR: ERROR: cmd.exe failed with args /c “C:/apache-ant-1.8.2/bin/ant.bat” debug
ProcessManager.KillAll: Trying to kill 1 spawned processes.
ProcessManager.KillAll: UE4Editor
ProcessManager.KillAll: Killing process: UE4Editor
ProcessResult.StopProcess: Process UE4Editor successfully exited.
Program.Main: AutomationTool exiting with ExitCode=1
Domain_ProcessExit
ProcessManager.KillAll: Trying to kill 0 spawned processes.
copying UAT log files…
RunUAT.bat ERROR: AutomationTool was unable to run successfully.
BUILD FAILED

My answer is probably usesless for you now but I had a similiar issue and I didn’t find the solution on the Internet, so I want to post my solution here so anybody can find it.
All you have to do is change some params in your project settings:

  1. Make sure that Platforms → Android → minimum SDK is set to API 19.
  2. Change the SDK API level to ‘matchndk’ and make sure that NDK API level is set to ‘android-19’ under Platforms → Android SDK.
    You could also try setting both SDK API level and NDK API level to ‘latest’.
    Notice: I’m also using UE4 4.8