Download

Error durring packaging (clang++)

Hi, I have few problems with my project (called Orange On Go) after I put my own c++ codes in it, but I think I fixed that up. I erased these codes, so they’re empty and also clone my project for “refreshing” some files. But now I have a problem when I try to package the project for android. The problem in the ouput log seems to be caused by clang++ encoding. It says:


MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool: Parsing headers for OrangeOnGo
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool: Reflection code generated for OrangeOnGo
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool: Compiling Native code with NDK API 'android-19'
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool: Performing 8 actions (4 in parallel)
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool: [1/8] clang++.exe OrangeOnGo.h [armv7-es2]
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool: [2/8] clang++.exe UELinkerFixupsName.h [armv7-es2]
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool: D:\OrangeOnGo\Intermediate\Build\Android\OrangeOnGo\Shipping\OrangeOnGo\OrangeOnGo.h(4,9) :  fatal error: UTF-16 
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool: #include "D:\OrangeOnGo\Source\OrangeOnGo\OrangeOnGo.h"
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool:          ^
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool: 1 error generated.
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool: [3/8] clang++.exe UELinkerFixups.cpp [armv7-es2]
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool: -------- End Detailed Actions Stats -----------------------------------------------------------
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool: ERROR: UBT ERROR: Failed to produce item: D:\OrangeOnGo\Binaries\Android\OrangeOnGo-Android-Shipping-armv7-es2.so
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool: Cumulative action seconds (8 processors): 0,00 building projects, 0,42 compiling, 0,00 creating app bundles, 0,00 generating debug info, 0,00 linking, 0,00 other
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool: UBT execution time: 14,00 seconds
MainFrameActions: Packaging (Android (ETC1)): CommandUtils.Run: Run: Took 14,2278138s to run UnrealBuildTool.exe, ExitCode=2
MainFrameActions: Packaging (Android (ETC1)): ErrorReporter.Error: ERROR: AutomationTool error: Command failed (Result:2): C:\Program Files\Epic Games\4.7\Engine\Binaries\DotNET\UnrealBuildTool.exe OrangeOnGo Android Shipping  D:\OrangeOnGo\OrangeOnGo.uproject  -noxge -rocket -NoHotReloadFromIDE. See logfile for details: 'UnrealBuildTool.txt' 
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 AutomationTool: Command failed (Result:2): C:\Program Files\Epic Games\4.7\Engine\Binaries\DotNET\UnrealBuildTool.exe OrangeOnGo Android Shipping  D:\OrangeOnGo\OrangeOnGo.uproject  -noxge -rocket -NoHotReloadFromIDE. See 
MainFrameActions: Packaging (Android (ETC1)): logfile for details: 'UnrealBuildTool.txt' 
MainFrameActions: Packaging (Android (ETC1)): Stacktrace:    v AutomationTool.CommandUtils.RunAndLog(String App, String CommandLine, String Logfile, Int32 MaxSuccessCode, String Input, ERunOptions Options, Dictionary`2 EnvVars)
MainFrameActions: Packaging (Android (ETC1)):    v AutomationTool.CommandUtils.RunUBT(CommandEnvironment Env, String UBTExecutable, String CommandLine, String LogName, Dictionary`2 EnvVars)
MainFrameActions: Packaging (Android (ETC1)):    v AutomationTool.UE4Build.BuildWithUBT(String ProjectName, String TargetName, UnrealTargetPlatform TargetPlatform, String Config, String UprojectPath, Boolean ForceMonolithic, Boolean ForceNonUnity, Boolean ForceDebugInfo, Boolean ForceFlushMac, Boolean DisableXGE, String InAddArgs, Boolean ForceUnity, Dictionary`2 EnvVars)
MainFrameActions: Packaging (Android (ETC1)):    v AutomationTool.UE4Build.Build(BuildAgenda Agenda, Nullable`1 InDeleteBuildProducts, Boolean InUpdateVersionFiles, Boolean InForceNoXGE, Boolean InForceNonUnity, Boolean InForceUnity, Dictionary`2 PlatformEnvVars)
MainFrameActions: Packaging (Android (ETC1)):    v Project.Build(BuildCommand Command, ProjectParams Params, Int32 WorkingCL)
MainFrameActions: Packaging (Android (ETC1)):    v BuildCookRun.DoBuildCookRun(ProjectParams Params)
MainFrameActions: Packaging (Android (ETC1)):    v BuildCommand.Execute()
MainFrameActions: Packaging (Android (ETC1)):    v AutomationTool.Automation.Execute(List`1 CommandsToExecute, CaselessDictionary`1 Commands)
MainFrameActions: Packaging (Android (ETC1)):    v AutomationTool.Automation.Process(String] CommandLine)
MainFrameActions: Packaging (Android (ETC1)):    v AutomationTool.Program.MainProc(Object Param)
MainFrameActions: Packaging (Android (ETC1)):    v AutomationTool.InternalUtils.RunSingleInstance(MainProc Main, Object Param)
MainFrameActions: Packaging (Android (ETC1)):    v AutomationTool.Program.Main()
MainFrameActions: Packaging (Android (ETC1)): Program.Main: ERROR: Command failed (Result:2): C:\Program Files\Epic Games\4.7\Engine\Binaries\DotNET\UnrealBuildTool.exe OrangeOnGo Android Shipping  D:\OrangeOnGo\OrangeOnGo.uproject  -noxge -rocket -NoHotReloadFromIDE. See logfile for details: 'UnrealBuildTool.txt' 
MainFrameActions: Packaging (Android (ETC1)): ProcessManager.KillAll: Trying to kill 0 spawned processes.
MainFrameActions: Packaging (Android (ETC1)): Program.Main: AutomationTool exiting with ExitCode=2
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 highlighted the lines that I think are most important. Any ideas how to fix this?

Hi Sojka,

Can you trycompiling as instructed in this forums post and see if that helps?

Change this file from UTF-16 to UTF-8 → D:\OrangeOnGo\Source\OrangeOnGo\OrangeOnGo.h

Chances are you will get the same error on other files as well. This happened to me … for some unknown reason the files are generated with UTF-16 by default. Open them in Notepad++ and change the encoding type.

This is your clue:

YES!! IT WORKED! :smiley: It seems that the UTF-16 is really not supported. So I changed the encoding of D:\OrangeOnGo\Source\OrangeOnGo\OrangeOnGo.h and D:\OrangeOnGo\Intermediate\Build\Android\OrangeOnGo\Shipping\OrangeOnGo\OrangeOnGo.h to UTF-8 (with BOM). It looked like it’s fixed. But because these headers files include other .cpp and .h files, I need to change them to UTF-8 as well (as you wrote). Firstly it showed error with some .h files (because of the UTF-16) and when I change their encoding, it showed error with .cpp files which were included (that means I need to change them too). After I changed about 6 .cpp and .h files it finally worked. The build in Visual Studio was successful and packaging in Unreal as well. Thank you guys… I finally heard the successful beep sound from the Unreal Packaging after a few weeks! :smiley:

(SORRY FOR THE ATTACHED IMAGES… I WAS WRITING FRISTLY SOMETHING DIFFERENT)

Glad you got it sorted … I also scratched my head over this one for a few days … I had to change about 6 files as well … I now however can happily package when I need to without having to change these files each time.

Good luck with your project. 8-}