UE 4.26 Switch Build Fails exit code 0xC0000005

Hello!

Since updating to 4.26 our project doesn’t package for Switch anymore. Other platforms are fine and I also reproduced it with a new project from the third person template. The plugin is in the project’s plugin folder.

It also doesn’t matter which build configuration I use or if it is a full package or trying to launch on the console from editor. Or whether or not it is initiated from the Editor package menu or via command line.

I tried on different PCs with fresh UE4 Source installs but it’s always the same. I don’t know if there is a way to debug the autmation tool crash further. If I disable the FMOD plugin from the project it deploys fine.

I’m using the respective SDK verison of the fmod release.

This is the error in the output log

UATHelper: Packaging (Switch):   Parsing headers for SwitchTest2
UATHelper: Packaging (Switch):     Running UnrealHeaderTool "D:\Projects\SwitchTest2\SwitchTest2.uproject" "D:\Projects\SwitchTest2\Intermediate\Build\Switch\SwitchTest2\Development\SwitchTest2.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -abslog="D:\UnrealEngine\UE_4.26\Engine\Programs\AutomationTool\Saved\Logs\UHT-SwitchTest2-Switch-Development.txt"
UATHelper: Packaging (Switch):   ERROR: UnrealHeaderTool failed with exit code 0xC0000005 - check that UE4 prerequisites are installed.
UATHelper: Packaging (Switch): Took 6,1566257s to run UnrealBuildTool.exe, ExitCode=-1073741819
UATHelper: Packaging (Switch): UnrealBuildTool failed. See log for more details. (D:\UnrealEngine\UE_4.26\Engine\Programs\AutomationTool\Saved\Logs\UBT-SwitchTest2-Switch-Development.txt)
UATHelper: Packaging (Switch): AutomationTool exiting with ExitCode=-1073741819 (-1073741819)
UATHelper: Packaging (Switch): BUILD FAILED
PackagingResults: Error: UnrealHeaderTool failed with exit code 0xC0000005 - check that UE4 prerequisites are installed.
PackagingResults: Error: Unknown Error

And this is in the UBT-SwitchTest2-Switch-Development.txt file

[...]
VCToolChain..ctor: Library Manager: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX64\x64\lib.exe
VCToolChain..ctor: Resource Compiler: C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64\rc.exe
HotReload.IsLiveCodingSessionActive: Checking for live coding mutex: Global\LiveCoding_D++UnrealEngine+UE_4.26+Engine+Binaries+Win64+UnrealHeaderTool.exe
ExternalExecution.ExecuteHeaderToolIfNecessary: Parsing headers for SwitchTest2
ExternalExecution.ExecuteHeaderToolIfNecessary:   Running UnrealHeaderTool "D:\Projects\SwitchTest2\SwitchTest2.uproject" "D:\Projects\SwitchTest2\Intermediate\Build\Switch\SwitchTest2\Development\SwitchTest2.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -abslog="D:\UnrealEngine\UE_4.26\Engine\Programs\AutomationTool\Saved\Logs\UHT-SwitchTest2-Switch-Development.txt"
ExternalExecution.ExecuteHeaderToolIfNecessary: ERROR: UnrealHeaderTool failed with exit code 0xC0000005 - check that UE4 prerequisites are installed.
UnrealBuildTool.Main: CompilationResultException: Error: -1073741819
UnrealBuildTool.Main:    at UnrealBuildTool.ExternalExecution.ExecuteHeaderToolIfNecessary(BuildConfiguration BuildConfiguration, FileReference ProjectFile, String TargetName, TargetType TargetType, Boolean bHasProjectScriptPlugin, List`1 UObjectModules, FileReference ModuleInfoFileName, Boolean bIsGatheringBuild, Boolean bIsAssemblingBuild, ISourceFileWorkingSet WorkingSet) in D:\UnrealEngine\UE_4.26\Engine\Source\Programs\UnrealBuildTool\System\ExternalExecution.cs:line 1172
UnrealBuildTool.Main:    at UnrealBuildTool.UEBuildTarget.Build(BuildConfiguration BuildConfiguration, ISourceFileWorkingSet WorkingSet, Boolean bIsAssemblingBuild, List`1 SpecificFilesToCompile) in D:\UnrealEngine\UE_4.26\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildTarget.cs:line 1729
UnrealBuildTool.Main:    at UnrealBuildTool.BuildMode.CreateMakefile(BuildConfiguration BuildConfiguration, TargetDescriptor TargetDescriptor, ISourceFileWorkingSet WorkingSet) in D:\UnrealEngine\UE_4.26\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 615
UnrealBuildTool.Main:    at UnrealBuildTool.BuildMode.Build(List`1 TargetDescriptors, BuildConfiguration BuildConfiguration, ISourceFileWorkingSet WorkingSet, BuildOptions Options, FileReference WriteOutdatedActionsFile, Boolean bSkipPreBuildTargets) in D:\UnrealEngine\UE_4.26\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 257
UnrealBuildTool.Main:    at UnrealBuildTool.BuildMode.Execute(CommandLineArguments Arguments) in D:\UnrealEngine\UE_4.26\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 226
UnrealBuildTool.Main:    at UnrealBuildTool.UnrealBuildTool.Main(String[] ArgumentsArray) in D:\UnrealEngine\UE_4.26\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:line 550
Timeline.Print: Timeline:
Timeline.Print: 
Timeline.Print: [ 0.000]
Timeline.Print: [ 0.014](+0.002) FileMetadataPrefetch.QueueEngineDirectory()
Timeline.Print: [ 0.017](+0.027) XmlConfig.ReadConfigFiles()
Timeline.Print: [ 0.045](+0.000) SingleInstanceMutex.Acquire()
Timeline.Print: [ 0.045](+0.102) UEBuildPlatform.RegisterPlatforms()
Timeline.Print:   0.046          [ 0.000](+0.033) Initializing InstalledPlatformInfo
Timeline.Print:   0.079          [ 0.034](+0.000) Querying types
Timeline.Print:   0.081          [ 0.036](+0.030) MacPlatformFactory
Timeline.Print:   0.111          [ 0.066](+0.004) TVOSPlatformFactory
Timeline.Print:   0.116          [ 0.071](+0.005) AndroidPlatformFactory
Timeline.Print:   0.122          [ 0.077](+0.002) HoloLensPlatformFactory
Timeline.Print:   0.125          [ 0.079](+0.004) IOSPlatformFactory
Timeline.Print:   0.129          [ 0.084](+0.009) LinuxPlatformFactory
Timeline.Print:   0.139          [ 0.094](+0.003) LuminPlatformFactory
Timeline.Print:   0.143          [ 0.098](+0.000) WindowsPlatformFactory
Timeline.Print:   0.143          [ 0.098](+0.004) SwitchPlatformFactory
Timeline.Print: [ 0.157](+0.002) DeleteJunk()
Timeline.Print: [ 0.159](+0.013) TargetDescriptor.ParseCommandLine()
Timeline.Print: [ 0.178](+0.495) UEBuildTarget.Create()
Timeline.Print:   0.182          [ 0.003](+0.217) RulesCompiler.CreateTargetRulesAssembly()
Timeline.Print:   0.182            0.003          [ 0.000](+0.118) <unknown>
Timeline.Print:   0.301            0.122          [ 0.118](+0.032) Finding engine modules
Timeline.Print:   0.334            0.155          [ 0.151](+0.001) Finding engine modules
Timeline.Print:   0.335            0.156          [ 0.152](+0.000) Finding engine modules
Timeline.Print:   0.335            0.156          [ 0.152](+0.003) Finding plugin modules
Timeline.Print:   0.339            0.160          [ 0.156](+0.041) <unknown>
Timeline.Print:   0.381            0.202          [ 0.198](+0.008) Finding program modules
Timeline.Print:   0.389            0.211          [ 0.207](+0.001) Finding program targets
Timeline.Print:   0.391            0.213          [ 0.209](+0.001) Finding program modules
Timeline.Print:   0.392            0.214          [ 0.210](+0.000) Finding program targets
Timeline.Print:   0.393            0.214          [ 0.210](+0.000) Finding program modules
Timeline.Print:   0.393            0.214          [ 0.210](+0.000) Finding program targets
Timeline.Print:   0.399          [ 0.221](+0.023) RulesAssembly.CreateTargetRules()
Timeline.Print:   0.430          [ 0.251](+0.065) UEBuildTarget constructor
Timeline.Print:   0.433            0.254          [ 0.002](+0.055) Reading source file metadata cache
Timeline.Print:   0.488            0.310          [ 0.058](+0.006) Reading source file metadata cache
Timeline.Print:   0.495          [ 0.317](+0.178) UEBuildTarget.PreBuildSetup()
Timeline.Print: [ 0.676](+5.417) UEBuildTarget.Build()
Timeline.Print:   0.676          [ 0.000](+0.106) <unknown>
Timeline.Print:   0.782          [ 0.106](+0.023) ExternalExecution.SetupUObjectModules()
Timeline.Print:   0.806          [ 0.130](+0.043) <unknown>
Timeline.Print:   0.850          [ 0.173](+0.211) Building UnrealHeaderTool
Timeline.Print:   0.850            0.173          [ 0.000](+0.047) UEBuildTarget.Create()
Timeline.Print:   0.850            0.173            0.000          [ 0.000](+0.000) RulesCompiler.CreateTargetRulesAssembly()
Timeline.Print:   0.850            0.173            0.000          [ 0.000](+0.038) RulesAssembly.CreateTargetRules()
Timeline.Print:   0.890            0.213            0.040          [ 0.040](+0.000) UEBuildTarget constructor
Timeline.Print:   0.890            0.213            0.040          [ 0.040](+0.007) UEBuildTarget.PreBuildSetup()
Timeline.Print:   0.898            0.221          [ 0.047](+0.112) UEBuildTarget.Build()
Timeline.Print:   0.901            0.225            0.051          [ 0.003](+0.001) ExternalExecution.SetupUObjectModules()
Timeline.Print:   0.903            0.226            0.053          [ 0.005](+0.000) ExternalExecution.UpdateDirectoryTimestamps()
Timeline.Print:   0.914            0.238            0.064          [ 0.016](+0.061) UEBuildBinary.Build()
Timeline.Print:   0.976            0.299            0.126          [ 0.078](+0.034) <unknown>
Timeline.Print:   1.016            0.339          [ 0.166](+0.001) ActionGraph.CheckPathLengths
Timeline.Print:   1.026            0.349          [ 0.175](+0.000) Reading action history
Timeline.Print:   1.026            0.349          [ 0.175](+0.005) Reading dependency cache
Timeline.Print:   1.032            0.355          [ 0.182](+0.004) Prefetching include dependencies
Timeline.Print:   1.036            0.359          [ 0.186](+0.020) Cache outdated actions
Timeline.Print:   1.079          [ 0.402](+5.014) Executing UnrealHeaderTool
Timeline.Print: [ 6.101](+0.000) FileMetadataPrefetch.Stop()
Timeline.Print: [ 6.103]

Kind Regards

It looks like the problem is the UE4 build tool not being able to compile the FMOD plugin for Switch due to a configuration issue. Do you know if your project contains any other C++ files which are being compiled for Switch when you package? If other C++ files are being compiled it narrows it down further to somehow being a problem with our integration, otherwise it sounds like it could be a setup issue.

Thanks for repsonding!

The project contains other c++ plugins and game code as well and builds fine when the fmod plugin is stripped.

I also tried deploying the third person template project with fmod in the project plugins and it throws the same error. Again it deploys fine when fmod is removed. There were no other plugins in the template project or engine install.

I also tried deleting the plugin and redownloading but I got the same result.

Kind Regards

I haven’t been able to reproduce this one locally using the third person template and our integration. Could you upload your third template project repro using your fmod.com profile page so that I can test directly with that?

I uploaded the unreal project once with and once without fmod and an empty fmod project that I used to test build the master bank with.

The plugin is 2.01.09 in the project because of the source control bug in 08, but the build behaves the same way in both versions.

Kind Regards

Thanks for those - I can reproduce the build problem now. I’m not sure yet what the cause is but with these repros we will aim to resolve it for the next release.

After a little more investigation I believe I’ve spotted the problem - we changed the way platform support is added to the integration in UE4 4.25, in line with similar changes Epic made to the engine, it looks like our docs got left behind though so the install instructions don’t describe this correctly for 4.25 and above.

I will make sure the installation guide in our docs gets updated for the next release, in the meantime I hope the correct instructions should get you unstuck.

As of UE4 4.25 the integration packages are split into two categories:

  1. The base integration package - Windows, Mac, or Linux.
  2. Platform specific integration packages for each console platform.

When installing the integration you need to install at least the base integration package for the platform you develop on, and then the packages for any additional platforms you are supporting.

The base integration packages should be extracted to MyGame\Plugins (replace MyGame with the root directory of your UE4 project). After extracting the base package into MyGame/Plugins you should have this kind of structure:

MyGame
+--- Binaries
+--- Config
+--- Content
+--- Plugins
     +--- FMODStudio
+--- Source
+--- MyGame.uproject

If you are adding multiple base integration packages extract all of them into MyGame\Plugins in any order. Files which are duplicated between the base integration packages can be overwritten.

When adding addition platform specific integration packages you should extract them directly into MyGame. After extracting them you should have this kind of structure (using Switch as an example):

MyGame
+--- Binaries
+--- Config
+--- Content
+--- Plugins
+--- Platforms
     +--- Switch
          +--- Plugins
               +--- FMODStudio
+--- Source
+--- MyGame.uproject

Looking at the projects you sent through it looks like you tried to follow our installation instructions and dragged the FMODStudio folder out of the Switch integration package into MyGame\Plugins. To fix this up the easiest thing to do is probably delete the MyGame\Plugins\FMODStudio folder and then follow the instructions I’ve given here to install the base integration package and Switch platform integration package.

Let me know if this doesn’t make sense, or if you’re still having trouble afterwards!

Thank you! That was it!

I wasn’t aware that it changed and imagined the new zip structure was simply the result of the build pipeline on your end.

Kind Regards and thanks again!

1 Like

Glad that fixed it, sorry for the confusion.