Packaging Xbox One UE4 fails to start due to not packaging fmodl.dll

When we package Xbox One builds of our game we find that they fail to start. Using the kernel debugger it appears that fmodl.dll (& I presume I need fmodstudiol.dll?) is not packaged into the build and thus the executable is failing to start.

How do I ensure that fmodl.dll is packaged into Xbox One?

Looking closer there are some other threads on here about FMOD & Xbox One. I don’t understand how PC packages correctly though with the dlls winding up in the finished build?

On PC, the UE4 engine automatically takes care of deployment of plugin dlls. But apparently this feature has not yet been rolled out to other platforms. So on Xbox One there are some manual steps you have to do.

You’ve probably found this already, but here is a link to the FMOD UE4 documentation that explains how to deploy the plugin on various platforms:

http://www.fmod.org/documentation/#content/generated/engine_ue4/deployment.html

Hello. Initially that link above did work but it was because I had a legacy plugin in my engine directory. Once this was deleted the deploy started to fail. It’s because the plugin is now in the game directory so this line:

		string FMODDLLPath = Path.Combine(Path.GetFullPath(BuildConfiguration.RelativeEnginePath), "Plugins/FMODStudio/Binaries/XboxOne/");

Needs to be:

		string FMODDLLPath = Path.Combine(Path.GetFullPath(InTarget.ProjectDirectory), "Plugins/FMODStudio/Binaries/XboxOne/");

This seems to work after an UnrealEngineBuildTool rebuild & UnrealFrontEnd

Hi Paul,
Thanks for the feedback. I’ll look in this and update the docs.

Hello,
That link now seems to fail when using latest FMOD & UE4.12.4. Specifically:

Deployment on XBox One
Add the following to StageRuntimeDependenciesFromReceipt in DeploymentContext.cs, just before the call to StageFile:

    // PLUGIN DEPLOYMENT START
    foreach (BuildProperty p in Receipt.Properties)
    {
        if (p.Name.Equals("Platform") && p.Value.Equals("XboxOne"))
        {
            RuntimeDependency.StagePath = RuntimeDependency.Path.Substring(RuntimeDependency.Path.LastIndexOf('\\') + 1);
        }
    }
    // PLUGIN DEPLOYMENT END

Is now producing the following error when I try and launch:

LogPlayLevel: DeploymentContext.cs(433,42): error CS1061: ‘TargetReceipt’ does not contain a definition for ‘Properties’ and no extension method ‘Properties’ accepting a first argument of type ‘TargetReceipt’ could be found (are you missing a using directive or an assembly reference?) [C:\src\PHX\M\Engine\Source\Programs\AutomationTool\AutomationUtils\Automa
tionUtils.Automation.csproj]
LogPlayLevel: DeploymentContext.cs(433,15): error CS0246: The type or namespace name ‘BuildProperty’ could not be found (are you missing a using directive or an assembly reference?) [C:\src\PHX\M\Engine\Source\Programs\AutomationTool\AutomationUtils\AutomationUtils.Automation.csproj]
LogPlayLevel: DeploymentContext.cs(437,26): error CS1061: ‘RuntimeDependency’ does not contain a definition for ‘StagePath’ and no extension method ‘StagePath’ accepting a first argument of type ‘RuntimeDependency’ could be found (are you missing a using directive or an assembly reference?) [C:\src\PHX\M\Engine\Source\Programs\AutomationTool\AutomationUtils
AutomationUtils.Automation.csproj]

Wondering what the work flow is for deploying FMOD on UE4.12.4 now days? Thanks.

I’m looking at this now and I’ll update the answer with the new method.

Unreal 4.12 still requires a workaround. The updated one is here, which should work regardless of whether FMODStudio is in the game or the engine plugins directory. I’ll update the official docs for next release, as well as pinging Epic for a better ETA on real support.

Add the following to GetFilesToDeployOrStage in XboxOnePlatform.Automation.cs, before the end of the function:

		// FMOD code start
		string FMODDLLPath = null;
		if (Directory.Exists(Path.Combine(SC.ProjectRoot, "Plugins/FMODStudio")))
		{
			FMODDLLPath = Path.Combine(SC.ProjectRoot, "Plugins/FMODStudio/Binaries/XBoxOne/");
		}
		else if (Directory.Exists(Path.Combine(SC.LocalRoot, "Engine/Plugins/FMODStudio")))
		{
			FMODDLLPath = Path.Combine(SC.LocalRoot, "Engine/Plugins/FMODStudio/Binaries/XBoxOne/");
		}
		else 
		{
			LogError("Failed to find FMODStudio plugin in game or engine directory");
		}
		if (FMODDLLPath != null)
		{
			Log("Copying FMOD dlls to loose directory: " + RelativeBinPath);
			SC.StageFiles(StagedFileType.NonUFS, FMODDLLPath, "fmod.dll", false, null, RelativeBinPath, false, false);
			SC.StageFiles(StagedFileType.NonUFS, FMODDLLPath, "fmodL.dll", false, null, RelativeBinPath, false, false);
			SC.StageFiles(StagedFileType.NonUFS, FMODDLLPath, "fmodstudio.dll", false, null, RelativeBinPath, false, false);
			SC.StageFiles(StagedFileType.NonUFS, FMODDLLPath, "fmodstudioL.dll", false, null, RelativeBinPath, false, false);
		}
		// FMOD code end

Add the following to PrepTargetForDeployment in XboxOneDeploy.cs, before the end of the function:

		// FMOD code start
		string FMODDLLPath = null;
		if (Directory.Exists(Path.Combine(InTarget.ProjectDirectory.FullName, "Plugins/FMODStudio")))
		{
			FMODDLLPath = Path.Combine(InTarget.ProjectDirectory.FullName, "Plugins/FMODStudio/Binaries/XBoxOne/");
		}
		else if (Directory.Exists(Path.Combine(BuildConfiguration.RelativeEnginePath, "Plugins/FMODStudio")))
		{
			FMODDLLPath = Path.Combine(BuildConfiguration.RelativeEnginePath, "Plugins/FMODStudio/Binaries/XBoxOne/");
		}
		else 
		{
			Log.TraceWarning("Failed to find FMODStudio plugin in game or engine directory");
		}
		if (FMODDLLPath != null)
		{
			Log.TraceInformation("...copying the FMOD dlls...");
			string FMODDLLName = "fmod.dll";
			Log.TraceInformation("\tcopying " + FMODDLLPath + FMODDLLName + " to " + DestDir + "/" + FMODDLLName);
			CopyFile(FMODDLLPath + FMODDLLName, DestDir + "/" + FMODDLLName, true);
			FMODDLLName = "fmodL.dll";
			Log.TraceInformation("\tcopying " + FMODDLLPath + FMODDLLName + " to " + DestDir + "/" + FMODDLLName);
			CopyFile(FMODDLLPath + FMODDLLName, DestDir + "/" + FMODDLLName, true);
			FMODDLLName = "fmodstudio.dll";
			Log.TraceInformation("\tcopying " + FMODDLLPath + FMODDLLName + " to " + DestDir + "/" + FMODDLLName);
			CopyFile(FMODDLLPath + FMODDLLName, DestDir + "/" + FMODDLLName, true);
			FMODDLLName = "fmodstudioL.dll";
			Log.TraceInformation("\tcopying " + FMODDLLPath + FMODDLLName + " to " + DestDir + "/" + FMODDLLName);
			CopyFile(FMODDLLPath + FMODDLLName, DestDir + "/" + FMODDLLName, true);
		}
		// FMOD code end

Hi,

we tried to follow you documentation but somehow it seems we have an old version or the docu is not up to date. When I add the code part from the post above to the PrepTargetForDeployment function in XboxOneDeploy.cs the variable DestDir is never set. I am using 4.14.3 and the error is correct. The variable DestDir is set during this function but inside a for loop. When I follow the instruction the code part I paste into the file is outside this for loop so the variable is never set.
Would be great to know to which dir the files need to be copied.
Cheers

As of 4.14 these modifications are no longer needed to deploy to Xbox One.

Thanks for the answer. I tried it without the modifications and then get the following error:
fmodL_vc.lib(fmodL.dll) : error LNK2001: Nicht aufgelöstes externes Symbol “__delayLoadHelper2”.
Would be great if you could update the documentation which modifications are needed and which not.

Sorry Tobias, to clarify:
If you are using an older version of our UE4 Integration (<1.08.15) it is safe to update to 1.08.16. This is also needed for the changes Epic put in place with Xbox One.

With that and Unreal Engine 4.14 or later, these modifications should no longer be required.

Hi Cameron,
thanks for the answer and now I deploy everything to Xbox but the game crashes with this error:
0128:012c @ 00007500 - LdrpFindOrMapDependency - ERROR: Loading DLL fmodL.dll failed with status 0xc0000135
0128:012c @ 00007500 - LdrpInitializeProcess - ERROR: Walking the import tables of the executable and its static imports failed with status 0xc0000135

Am I still missing some dlls?
I found this entry in a thread, but you mentioned there is no need for further editing source files manually?
https://www.fmod.org/questions/question/cooking-xbox-with-ue-4-9-2/

I am having the same issue right now in 2.24.3 as originally described in this thread from 5 years ago. I tried the code but that ends up coming up a few more of the missing sybmol warnings.

this is the closes to the exact issue i have been, is there any more info or updates to this?

Have you followed the steps for modifying the build files?

https://fmod.com/resources/documentation-ue4?version=2.1&page=platform-specifics.html#copying-dlls-to-build

Hi, Cameron
I have the same issue with UE 4.24 and FMOD 2.01.05
FMOD dll’s was copied to Saved/XboxOne/Layout/Image/Loose/Project\Binaries\XboxOne/ directory belong .exe but in Layout.xml destination path set to <game>\Plugins\FMODStudio\Binaries\XboxOne and the same path when deploying to devkit

I am currently looking into this and should have more for you shortly.

The fix for this is in for the next release, in the meantime I updated it on our Github repo:

XboxOne - Fixed users having to modify engine code to copy libs. · fmod/ue4integration@c45faf4 (github.com)