Android packaging build fail - UE 4.18

Hello, I get the build file error below:

UEDeployAndroid.MakeApk:
====31-10-2017 09:51:22====PERFORMING FINAL APK PACKAGE
OPERATION================================================ UEDeployAndroid.CreateRunGradle:
UEDeployAndroid.CreateRunGradle:
Creating rungradle.bat to work around
commandline length limit (using unused
drive letter Z:)
UEDeployAndroid.RunCommandLineProgramWithException:
Making .apk with Gradle…
ExceptionUtils.PrintExceptionInfo:
============================================================================== ExceptionUtils.PrintExceptionInfo:
ERROR: cmd.exe failed with args /c
“D:\Stage -
kornelis\ARcore\HelloARSample
4.18\Intermediate/Android/APK\gradle\rungradle.bat”
:app:assembleDebug
ExceptionUtils.PrintExceptionInfo:
(see
C:\Users\coolb\AppData\Roaming\Unreal
Engine\AutomationTool\Logs\D+Program+Files+Epic+Games+UE_4.18\UAT_Log.txt
for full exception trace)
ExceptionUtils.PrintExceptionInfo:
ExceptionUtils.PrintExceptionInfo:
BuildException: cmd.exe failed with
args /c “D:\Stage -
kornelis\ARcore\HelloARSample
4.18\Intermediate/Android/APK\gradle\rungradle.bat”
:app:assembleDebug
ExceptionUtils.PrintExceptionInfo:
bij
UnrealBuildTool.UEDeployAndroid.RunCommandLineProgramWithException(String
WorkingDirectory, String Command,
String Params, String OverrideDesc,
Boolean bUseShellExecute)
ExceptionUtils.PrintExceptionInfo:
bij
UnrealBuildTool.UEDeployAndroid.MakeApk(AndroidToolChain
ToolChain, String ProjectName, String
ProjectDirectory, String OutputPath,
String EngineDirectory, Boolean
bForDistribution, String CookFlavor,
Boolean bMakeSeparateApks, Boolean
bIncrementalPackage, Boolean
bDisallowPackagingDataInApk, Boolean
bDisallowExternalFilesDir)
ExceptionUtils.PrintExceptionInfo:
bij
UnrealBuildTool.UEDeployAndroid.PrepForUATPackageOrDeploy(FileReference
ProjectFile, String ProjectName,
DirectoryReference ProjectDirectory,
String ExecutablePath, String
EngineDirectory, Boolean
bForDistribution, String CookFlavor,
Boolean bIsDataDeploy)
ExceptionUtils.PrintExceptionInfo:
bij
AndroidPlatform.Package(ProjectParams
Params, DeploymentContext SC, Int32
WorkingCL)
ExceptionUtils.PrintExceptionInfo:
bij Project.Package(ProjectParams
Params, Int32 WorkingCL)
ExceptionUtils.PrintExceptionInfo:
bij
BuildCookRun.DoBuildCookRun(ProjectParams
Params)
ExceptionUtils.PrintExceptionInfo:
bij BuildCookRun.ExecuteBuild()
ExceptionUtils.PrintExceptionInfo:
bij
AutomationTool.BuildCommand.Execute()
ExceptionUtils.PrintExceptionInfo:
bij
AutomationTool.Automation.Execute(List1 CommandsToExecute, Dictionary2
Commands)
ExceptionUtils.PrintExceptionInfo:
bij
AutomationTool.Automation.Process(String
Arguments)
ExceptionUtils.PrintExceptionInfo:
bij
AutomationTool.Program.MainProc(Object
Param)
ExceptionUtils.PrintExceptionInfo:
bij
AutomationTool.InternalUtils.RunSingleInstance(Func`2
Main, Object Param)
ExceptionUtils.PrintExceptionInfo:
bij AutomationTool.Program.Main()
ExceptionUtils.PrintExceptionInfo:
============================================================================== Program.Main: AutomationTool exiting
with ExitCode=1 (Error_Unknown)

I hope that someone can tell me what goes wrong and how to fix it?

try to uncheck “Enable gradle instead of ant” in project settings → android.

Yeah, I found this “fix” in different topics here on UE answers. But this won’t work! giving the same error somehow!

How to fix? Please give me a link,thx

I succeeded package with “Enable gradle instead of ant” enabled.

  1. run NVPACK/android-sdk-windows/tools/android.bat
  2. click on “Deselect All”
  3. update Extras/Android Support Repository

Hi. I had the same issues as mentioned above and I tried what you (okqi) are saying.

IT WORKED

thanks.

Worked thank you!

I am using UE 4.18.2 and also update the lastest Android Support Repository (Rev47).
But I still get this error somehow.
Anyone know why?thanks

This is the perfect answer! it worked on 4.18.2

This fix did the job Thank you :slight_smile:

Thank you very much!!

I was facing the same promises,
I’ll tie the:
Enable Gradle instead of Ant
And the NDK API Lelel (spcific version or lastest) for: "lastest

and finally I was able to compile the app.
good luck

Thank you so much, this is very helpful!

Thanks, it worked for me =)

It Work for me, thank you.

Yeah, same here. I already have Gradle enabled instead of Ant and I have the latest version of Android Support Repository. If someone could assist us, that would be grand.

Hi I’m goku ;).

For those who have errors in GRADLE.

1 ° Deactivate in unreal in the configurations of your project.

2 Delete the INTERMEDIATE folder in the folder where your project is located. It is not necessary to be afraid to delete the project from the pre-saved packaging (FOLDER INTERMEDIATE). This will not delete the base (master) project.

3 Open your project on unreal and see if GRADLE is disabled again. It’s ok

4 ° All ready to pack, without errors GRADLES.

5 ° Pay a beer for me, and I will always help :slight_smile:
Welcome to the unreal world, where everything is paid, even the air that your character will virtually breathe on the platform.

Within unreal in project settings / platforms / android … search android package Name must be composed of two names separated by a period (example: com.mygame)

To anybody else experiencing this problem that couldn’t find a fix, I had the same error and it turned out to be my firewall blocking it from running.

Me as well