Android project name causes ant.bat error

Hi, sorry for my bad english, i am italian…I have a problem when i try to package my android game…the error is this:

*MainFrameActions: Packaging (Android (ETC1)): ====28/05/2015 20:13:28====PERFORMING FINAL APK PACKAGE OPERATION================================================
MainFrameActions: Packaging (Android (ETC1)): UEDeployAndroid.RunCommandLineProgramAndThrowOnError: Making .apk with Ant... (note: it's safe to ignore javac obsolete warnings)
MainFrameActions: Packaging (Android (ETC1)): BUILD FAILED
MainFrameActions: Packaging (Android (ETC1)): C:\\android-sdk-windows\tools\ant\build.xml:653: The following error occurred while executing this line:
MainFrameActions: Packaging (Android (ETC1)): C:\\android-sdk-windows\tools\ant\build.xml:698: null returned: 1
MainFrameActions: Packaging (Android (ETC1)): Total time: 8 seconds
MainFrameActions: Packaging (Android (ETC1)): BuildCommand.Execute: ERROR: BUILD FAILED
MainFrameActions: Packaging (Android (ETC1)): Program.Main: ERROR: AutomationTool terminated with exception:
MainFrameActions: Packaging (Android (ETC1)): Program.Main: ERROR: Exception in UnrealBuildTool: ERROR: cmd.exe failed with args /c "C://apache-ant-1.8.2/bin/ant.bat" -quiet release
MainFrameActions: Packaging (Android (ETC1)): Stacktrace:    in UnrealBuildTool.Android.UEDeployAndroid.RunCommandLineProgramAndThrowOnError(String WorkingDire
MainFrameActions: Packaging (Android (ETC1)): ctory, String Command, String Params, String OverrideDesc, Boolean bUseShellExecute)
MainFrameActions: Packaging (Android (ETC1)):    in UnrealBuildTool.Android.UEDeployAndroid.MakeApk(String ProjectName, String ProjectDirectory, String OutputPath, String EngineDirectory, Boolean bForDistribution, String CookFlavor, Boolean bMakeSeparateApks, Boolean bIncrementalPackage, Boolean bDisallowPackagingDataInApk)
MainFrameActions: Packaging (Android (ETC1)):    in UnrealBuildTool.Android.UEDeployAndroid.PrepForUATPackageOrDeploy(String ProjectName, String ProjectDirectory, String ExecutablePath, String EngineDirectory, Boolean bForDistribution, String CookFlavor, Boolean bIsDataDeploy)
MainFrameActions: Packaging (Android (ETC1)):    in AndroidPlatform.Package(ProjectParams Params, DeploymentContext SC, Int32 WorkingCL)
MainFrameActions: Packaging (Android (ETC1)):    in Project.Package(ProjectParams Params, Int32 WorkingCL)
MainFrameActions: Packaging (Android (ETC1)):    in BuildCookRun.DoBuildCookRun(ProjectParams Params)
MainFrameActions: Packaging (Android (ETC1)):    in BuildCommand.Execute()
MainFrameActions: Packaging (Android (ETC1)):    in AutomationTool.Automation.Execute(List`1 CommandsToExecute, CaselessDictionary`1 Commands)
MainFrameActions: Packaging (Android (ETC1)):    in AutomationTool.Automation.Process(String[] CommandLine)
MainFrameActions: Packaging (Android (ETC1)):    in AutomationTool.Program.MainProc(Object Param)
MainFrameActions: Packaging (Android (ETC1)):    in AutomationTool.InternalUtils.RunSingleInstance(MainProc Main, Object Param)
MainFrameActions: Packaging (Android (ETC1)):    in AutomationTool.Program.Main()
MainFrameActions: Packaging (Android (ETC1)): Program.Main: ERROR: ERROR: cmd.exe failed with args /c "C://apache-ant-1.8.2/bin/ant.bat" -quiet release
MainFrameActions: Packaging (Android (ETC1)): ProcessManager.KillAll: Trying to kill 0 spawned processes.
MainFrameActions: Packaging (Android (ETC1)): Program.Main: AutomationTool exiting with ExitCode=1
MainFrameActions: Packaging (Android (ETC1)): Domain_ProcessExit
MainFrameActions: Packaging (Android (ETC1)): ProcessManager.KillAll: Trying to kill 0 spawned processes.
MainFrameActions: Packaging (Android (ETC1)): copying UAT log files...
MainFrameActions: Packaging (Android (ETC1)): RunUAT.bat ERROR: AutomationTool was unable to run successfully.
MainFrameActions: Packaging (Android (ETC1)): BUILD FAILED*

I tried different solutions how:
-Unistall and reinstall Unreal Engine and TADP
-Install TADP 4.0r1
-Install only API19 (i read this in a post here)
(The path in Project Setting-Android SDK-SDK Config are right…) But the problem seems to be apache ant…(i tried also with the last versione apache-ant-1.9.4 and nothing…) So help me please i don’t know what to think!

Hey Baziga,

Which version of the Editor are you working within? Could you please see whether or not you’re able to package any other project from this version of the Engine? I suggest for you to download Tappy Chicken and package for ETC1 in development. If you’re able to package that, then it’s not TADP.

Please provide me the error from your original project and also please provide me any additional error that you receive when trying to package Tappy Chicken out.

Looking forward to hearing back from you, thanks!

Hi , I’m work with Unreal 4.7.6…It’s strange, i tried with Tappy Chicken and the packaging has been successful…I tried again with the same configuration of Tappy Chicken and nothin, don’t work… Thank you!

The file log

Hi Bazinga,

From your it looks like you’ve got the SDK still set to ‘android 21’, you’ll want to set that to ‘android 19’. That is not causing your build failure, but it will cause your project to not work on devices with less than Android OS 5.0.

Next, please roll back to the apache-ant-1.8.2, and make sure that your editor’s project settings [Platforms-Android SDK setup looks like this screenshot.][1] It may be that properly set up the newest version of Apache should work, but when people have problems with it (and from your it looks like Ant is where it fails every time) I usually recommend they go back to the one we know the engine works on. Then restart your computer as you have changed your SDK.

Further, have you [set up your environment variables][2] according to this documentation? I am assuming so since you were able to package Tappy, but this is just to remove all possible problems.

Once you check these things, please try to package Tappy for development and ETC1 one more time, and then your project regardless of whether Tappy fails or succeeds, and include both sets of output here as a txt file.

Good luck!

Android Development Install Problem UE4 4.7.3 - Mobile - Epic Developer Community Forums
[2]: Android Development Basics for Unreal Engine | Unreal Engine 5.1 Documentation

Hi wittlief! Thank for your answer! The environment variables and the editor’s project settings are right setup. The packaging of Tappy Chicken in development mode has been succesful, in shipping mode no…And my project both in development mode and shipping mode no…
I understand the problem, but I do not know how to fix it…The problem is with:

C:\\android-sdk-windows\tools\ant\build.xml:649: The following error occurred while executing this line:
MainFrameActions: Packaging (Android (ETC1)): C:\\android-sdk-windows\tools\ant\build.xml:694: null returned: 1

It is not a problem with Unreal Engine, this problem have many people on the internet I read, just do not understand how solve…because I do not use their programs…

Update: The problem is also:
ERROR: cmd.exe failed with args /c “C://apache-ant-1.8.2/bin/ant.bat” -quiet release

This is the new file log:

Yes, it’s not specific to UE which makes it infuriatingly hard to diagnose, and your are mostly error free but the ant.bat one, which also makes it even tougher. Sometimes it’s something as small and impossible to find [as a space in something that isn’t supposed to be there][1].

Here’s some more things you can try:

Since you’re mostly having problems with shipping/distribution builds, [double check that you have your keystore set up,][2] it is necessary for distribution.

[Make sure to try this one][3], just to be on the safe side.

I don’t see any proguard errors in your , but just in case [here are two threads wherein proguard][4] was the [problem and how it was fixed.][5]

Lastly, you can delete your current build of TADP and upgrade to the most recent. Just make sure you have SDK 19 and NDK checked when installing.

So, good luck! Sorry I can’t be more specific on this one.

UE 4.7.2 can't pack .apk with Ant - Programming & Scripting - Epic Developer Community Forums
[2]: Sign your app  |  Android Studio  |  Android Developers
[3]: Cmd.exe failed with args /c "C:\NVPACK\apache-ant-1.8.2/bin/ant.bat" -quiet debug - Debugging, Optimization, & Profiling - Epic Developer Community Forums
[4]: Android for distribution fails to load on device - Mobile - Epic Developer Community Forums
[5]: 4.7 Android Shipping crash on launch - Mobile - Epic Developer Community Forums

I solved finally! You said well, It was something as small and impossible to find, because I thought that the problem was TADP or apache ant…The problem was in Project-Android → Android package name…I had written the title of my game between “[ ]”…Now i can package my game finally! I hope this thread will be useful to someone else! Thank you so much for the help and the patience!

Hooray!

Let us know if you have any other problems.

Wait, when you see “com.YourCompany.[PROJECT]”, you’re not suppose to put your name in the “PROJECT” part??

Maybe I wrote wrong, because i don’t know the english, i have put the name in [Project], but i have put also the bracket square with the name… and this caused error build with apache ant!

So the square brackets aren’t suppose to be in there? Could you show me an example of how it’s suppose to be done? I’m feeling more confused.

In Android Package Name, you must write (Example):

com…nameofyourgame <— without square brackets

I don’t know what is your developer name, I have put your in the example…

Small and impossible. That exactly my issue. TKS saved my life today!!!