Android Build/Package Error

When I build my C++ game for Android, I get the following error:

Packaging (Android): CommandUtils.Run: Run: D:\Github\UnrealEngine\Engine\Binaries\DotNET\UnrealBuildTool.exe Test Android Development -clean "C:\Users\Evans\Documents\Unreal Projects\Test\Test.uproject" -nobuilduht Packaging (Android): UnrealBuildTool: ERROR: Couldn't find target rules file for target '-clean' in rules assembly '-cleanModuleRules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. ... ... ... BuildCommand.Execute: ERROR: BUILD FAILED Program.Main: ERROR: AutomationTool terminated with exception: Program.Main: ERROR: Exception in AutomationTool: Command failed (Result:1): D:\Github\UnrealEngine\Engine\Binaries\DotNET\UnrealBuildTool.exe Test Android Development -clean "C:\Users\Evans\Documents\Unreal Projects\Test\Test.uproject" -nobuilduht. See logfile for details: 'UnrealBuildTool.txt'

Here’s the stack trace:

Stacktrace: at AutomationTool.CommandUtils.RunAndLog(String App, String CommandLine, String Logfile, Int32 MaxSuccessCode) in ProcessUtils.cs:line 759
at AutomationTool.CommandUtils.RunUBT(CommandEnvironment Env, String UBTExecutable, String CommandLine, String LogName) in UBTUtils.cs:line 29
at AutomationTool.UE4Build.CleanWithUBT(String ProjectName, String TargetName, UnrealTargetPlatform Platform, String Config, String UprojectPath, Boolean ForceMonolithic, Boolean ForceNonUnity, Boolean ForceDebugInfo, String InAddArgs, Boolean ForceUnity) in UE4Build.cs:line 268
at AutomationTool.UE4Build.Build(BuildAgenda Agenda, Nullable1 InDeleteBuildProducts, Boolean InUpdateVersionFiles, Boolean InForceNoXGE, Boolean InForceNonUnity, Boolean InForceUnity) in UE4Build.cs:line 1214 at Project.Build(BuildCommand Command, ProjectParams Params, Int32 WorkingCL) in Scripts\BuildProjectCommand.Automation.cs:line 111 at BuildCookRun.DoBuildCookRun(ProjectParams Params) in Scripts\BuildCookRun.Automation.cs:line 235 at BuildCommand.Execute() in BuildCommand.cs:line 37 at AutomationTool.Automation.Execute(List1 CommandsToExecute, CaselessDictionary`1 Commands) in Automation.cs:line 357
at AutomationTool.Automation.Process(String[] CommandLine) in Automation.cs:line 325
at AutomationTool.Program.MainProc(Object Param) in Program.cs:line 88
at AutomationTool.InternalUtils.RunSingleInstance(MainProc Main, Object Param) in Utils.cs:line 568
at AutomationTool.Program.Main() in Program.cs:line 48
Program.Main: ERROR: Command failed (Result:1):
D:\Github\UnrealEngine\Engine\Binaries\DotNET\UnrealBuildTool.exe Test Android Development -clean “C:\Users\Evans\Documents\Unreal Projects\Test\Test.uproject” -nobuilduht. See logfile for details: ‘UnrealBuildTool.txt’
copying UAT log files…
RunUAT.bat ERROR: AutomationTool was unable to run successfully.
BUILD FAILED

I’m not able to build for Windows either. I get the same error.

I’m building the engine from source.

I couldn’t find UnrealBuildTool.txt anywhere on my computer, so I ran UnrealBuildTool passing the same command line parameters to it. I got the same output which was shown in the log:

ERROR: Couldn't find target rules file for target '-clean' in rules assembly '-c leanModuleRules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Location: C:\Users\Evans\Documents\Unreal Projects\Test\Intermediate\Build\Build Rules\-cleanModuleRules.dll Target rules found: UE4Client - D:\Github\UnrealEngine\Engine\Source\UE4Client.Target.cs UE4Editor - D:\Github\UnrealEngine\Engine\Source\UE4Editor.Target.cs UE4Game - D:\Github\UnrealEngine\Engine\Source\UE4Game.Target.cs UE4Server - D:\Github\UnrealEngine\Engine\Source\UE4Server.Target.cs BlankProgram - D:\Github\UnrealEngine\Engine\Source\Programs\BlankProgra m\BlankProgram.Target.cs CrashReportClient - D:\Github\UnrealEngine\Engine\Source\Programs\CrashR eporter\CrashReportClient\CrashReportClient.Target.cs MinidumpDiagnostics - D:\Github\UnrealEngine\Engine\Source\Programs\Cras hReporter\MinidumpDiagnostics\MinidumpDiagnostics.Target.cs UnrealLaunchDaemon - D:\Github\UnrealEngine\Engine\Source\Programs\IOS\U nrealLaunchDaemon\UnrealLaunchDaemon.Target.cs ShaderCompileWorker - D:\Github\UnrealEngine\Engine\Source\Programs\Shad erCompileWorker\ShaderCompileWorker.Target.cs SlateViewer - D:\Github\UnrealEngine\Engine\Source\Programs\SlateViewer\ SlateViewer.Target.cs SymbolDebugger - D:\Github\UnrealEngine\Engine\Source\Programs\SymbolDeb ugger\SymbolDebugger.Target.cs UnrealFileServer - D:\Github\UnrealEngine\Engine\Source\Programs\UnrealF ileServer\UnrealFileServer.Target.cs UnrealFrontend - D:\Github\UnrealEngine\Engine\Source\Programs\UnrealFro ntend\UnrealFrontend.Target.cs UnrealHeaderTool - D:\Github\UnrealEngine\Engine\Source\Programs\UnrealHeaderTool\UnrealHeaderTool.Target.cs UnrealLightmass - D:\Github\UnrealEngine\Engine\Source\Programs\UnrealLightmass\UnrealLightmass.Target.cs UnrealPak - D:\Github\UnrealEngine\Engine\Source\Programs\UnrealPak\UnrealPak.Target.cs Test - C:\Users\Evans\Documents\Unreal Projects\Test\Source\Test.Target.cs TestEditor - C:\Users\Evans\Documents\Unreal Projects\Test\Source\TestEditor.Target.cs

The part that’s the most important in that output is:

"Command failed (Result:1):
D:\Github\UnrealEngine\Engine\Binaries\DotNET\UnrealBuildTool.exe Test Android Development -clean "C:\Users\Evans\Documents\Unreal Projects\Test\Test.uproject" -nobuilduht.
See logfile for details: 'UnrealBuildTool.txt'"

Is there anything in that log file (UnrealBuildTool.txt) that might give us a bit more insight into what’s happening here?

I’ve updated the question with the output of UnrealBuildTool.

Ah, ok. Missed that due to the bunching together of lines (I’ll put in a request to see if we can get that fixed as well.)

I’ll ask around and see if anyone has some thoughts on this. I’m wondering if it might be related to you using a mix of launcher and github source, but I can’t think of what issue that might cause.

I did a little bit of debugging and found that UnrealBuildTool fails in RulesCompiler::CreateTargetRules() because TargetNameToTargetFileMap doesn’t contain either “-clean” or “-generatemanifest”. The map is populated by iterating through some source files, but I couldn’t find any source file directly corresponding to -clean or -generatemanifest.
The build seems to continue if I make it ignore “-clean” but '-generatemanifest" seems mandatory, since a manifest is required.
While you’re working on a fix, please let me know if there is a workaround I could use.

I uninstalled the launcher but that doesn’t help. I was previously using Required_1of2.zip from the 4.0.1 release, but now I’ve updated it. Would that have anything to do with the error?

If you’re still seeing this problem, can you try naming your project something other than ‘Test’?

I haven’t seen this error after upgrading to 4.1

This was probably fixed in 4.1. I haven’t seen this error after upgrading.

Got the same error with the 4.3 source (from zip)

Error	1	error : CrashReportClient does not support the Android platform.	D:\DO_NOT_ARGUE\GAMES\UE4\SOURCE\UnrealEngine-4.3\Engine\Intermediate\ProjectFiles\EXEC	CrashReportClient

Error	2	error MSB3073: The command "..\..\Build\BatchFiles\Build.bat CrashReportClient Android Shipping" exited with code -1.	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets	38	5	CrashReportClient

Hello,

Thank you for your report. We were not able to investigate this on the engine version you reported, but there have been many version changes to UE4 since this question was first posted. With a new version of the Engine comes new fixes and it is possible that this issue has changed or may no longer occur. Due to timetable of when this issue was first posted, we are marking this post as resolved for tracking purposes. If you are still experiencing the issue you reported in the current engine version, then please respond to this message with additional information and we will investigate as soon as possible. If you are experiencing a similar, but different issue at this time, could you please submit a new report for it.

Thanks!