# Player build: fmodstudioL.dll not found (in wrong folder)

**URL:** <https://qa.fmod.com/t/player-build-fmodstudiol-dll-not-found-in-wrong-folder/15470>\
**Category:** Unity\
**Created:** [February 18, 2020, 12:42pm UTC](https://qa.fmod.com/t/player-build-fmodstudiol-dll-not-found-in-wrong-folder/15470 "2020-02-18T12:42:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![isaac.ashdown](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/isaac.ashdown/32/961_2.png) [@isaac.ashdown](https://qa.fmod.com/u/isaac.ashdown)\
**Post date:** [February 18, 2020, 12:42pm UTC](https://qa.fmod.com/t/player-build-fmodstudiol-dll-not-found-in-wrong-folder/15470/1 "2020-02-18T12:42:37Z")

</div>

Hi,  
We’re using Unity 2019.3.1f1 and FMOD plugin 2.00.07.  
I’m not sure what’s made this problem begin - probably updating unity, but we were using the 2019.3 beta and didn’t have any trouble there.  
When starting our game we get the following errors:

```
Fallback handler could not load library C:/isaac/mm-bitbucket/ce2/Tools/jenkins/output/CE2_Data/Mono/fmodstudioL
Fallback handler could not load library C:/isaac/mm-bitbucket/ce2/Tools/jenkins/output/CE2_Data/Mono/fmodstudioL.dll
Fallback handler could not load library C:/isaac/mm-bitbucket/ce2/Tools/jenkins/output/CE2_Data/Mono/fmodstudioL
Fallback handler could not load library C:/isaac/mm-bitbucket/ce2/Tools/jenkins/output/CE2_Data/Mono/libfmodstudioL
Fallback handler could not load library C:/isaac/mm-bitbucket/ce2/Tools/jenkins/output/CE2_Data/Mono/libfmodstudioL.dll
Fallback handler could not load library C:/isaac/mm-bitbucket/ce2/Tools/jenkins/output/CE2_Data/Mono/libfmodstudioL
Fallback handler could not load library C:/isaac/mm-bitbucket/ce2/Tools/jenkins/output/CE2_Data/Mono/fmodstudioL
Fallback handler could not load library C:/isaac/mm-bitbucket/ce2/Tools/jenkins/output/CE2_Data/Mono/fmodstudioL.dll
Fallback handler could not load library C:/isaac/mm-bitbucket/ce2/Tools/jenkins/output/CE2_Data/Mono/fmodstudioL
Fallback handler could not load library C:/isaac/mm-bitbucket/ce2/Tools/jenkins/output/CE2_Data/Mono/libfmodstudioL
Fallback handler could not load library C:/isaac/mm-bitbucket/ce2/Tools/jenkins/output/CE2_Data/Mono/libfmodstudioL.dll
Fallback handler could not load library C:/isaac/mm-bitbucket/ce2/Tools/jenkins/output/CE2_Data/Mono/libfmodstudioL
DllNotFoundException: fmodstudioL
  at (wrapper managed-to-native) FMOD.Memory.FMOD5_Memory_GetStats(int&,int&,bool)
  at FMOD.Memory.GetStats (System.Int32& currentalloced, System.Int32& maxalloced, System.Boolean blocking) [0x00001] in C:\isaac\mm-bitbucket\ce2\Assets\Plugins\FMOD\src\Runtime\wrapper\fmod.cs:788 
  at FMODUnity.RuntimeUtils.EnforceLibraryOrder () [0x00001] in C:\isaac\mm-bitbucket\ce2\Assets\Plugins\FMOD\src\Runtime\RuntimeUtils.cs:404 
  at FMODUnity.RuntimeManager.get_Instance () [0x00109] in C:\isaac\mm-bitbucket\ce2\Assets\Plugins\FMOD\src\Runtime\RuntimeManager.cs:103 
Rethrow as SystemNotInitializedException: [FMOD] Initialization failed
  at FMODUnity.RuntimeManager.get_Instance () [0x00148] in C:\isaac\mm-bitbucket\ce2\Assets\Plugins\FMOD\src\Runtime\RuntimeManager.cs:113 
  at FMODUnity.RuntimeManager.get_StudioSystem () [0x00001] in C:\isaac\mm-bitbucket\ce2\Assets\Plugins\FMOD\src\Runtime\RuntimeManager.cs:127 
  at FMODUnity.RuntimeManager.GetBus (System.String path) [0x00001] in C:\isaac\mm-bitbucket\ce2\Assets\Plugins\FMOD\src\Runtime\RuntimeManager.cs:1058 

```

The dll is there in the player build at the path  
`CE2_Data/Plugins`

But if I manually copy the dlls to  
`CE2_Data/Plugins/x86_64`

Then the problem doesn’t happen.

---

<div class="post-metadata">

**Author:** ![nickstevens000](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/nickstevens000/32/967_2.png) [@nickstevens000](https://qa.fmod.com/u/nickstevens000)\
**Post date:** [February 19, 2020, 10:15am UTC](https://qa.fmod.com/t/player-build-fmodstudiol-dll-not-found-in-wrong-folder/15470/2 "2020-02-19T10:15:52Z")

</div>

Having the same problem here. Except I’m on 2019.2.19f1 with FMOD 2.00.07.

I wasn’t having any problems with Unity 2017.4 and 2018.4, but 2019.2 doesn’t seem to load the fmod plugins at all. I would prefer not having to manually move .dll’s after a build.

Can also confirm moving them to x86\_64 folder makes the plugins work.

Hoping we can get some help.

---

<div class="post-metadata">

**Author:** ![nickstevens000](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/nickstevens000/32/967_2.png) [@nickstevens000](https://qa.fmod.com/u/nickstevens000)\
**Post date:** [February 20, 2020, 2:14am UTC](https://qa.fmod.com/t/player-build-fmodstudiol-dll-not-found-in-wrong-folder/15470/3 "2020-02-20T02:14:05Z")

</div>

Update: As a temporary fix, I’m using this script to move the .dll files automatically. The script is quick and dirty but I’m not too informed on what else there is to do in this situation.

[https://www.paste.org/103088](https://www.paste.org/103088)

```
using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
 
public class fmod_dll_fix
{
 
    //Callback to the build path.
    [PostProcessBuildAttribute(999)]
    public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
    {
        var fixedPath = pathToBuiltProject.Replace(".exe", "_Data/Plugins");
        var newDllPath = Path.Combine(fixedPath, "x86_64");
 
        string[] dllsToMove = new string[]
        {
            "fmodstudio.dll",
            "fmodstudiol.dll",
            "resonanceaudio.dll"
        };
 
        foreach (var dll in dllsToMove)
        {
            var oldPath = Path.Combine(fixedPath, dll);
            var newPath = Path.Combine(newDllPath, dll);
            File.Move(oldPath, newPath);
 
            Debug.Log(string.Format("Moved {0} from old path: {1} to new path: {2}", dll, oldPath, newPath));
        }
    }
}
```

---

<div class="post-metadata">

**Author:** ![isaac.ashdown](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/isaac.ashdown/32/961_2.png) [@isaac.ashdown](https://qa.fmod.com/u/isaac.ashdown)\
**Post date:** [February 20, 2020, 7:51pm UTC](https://qa.fmod.com/t/player-build-fmodstudiol-dll-not-found-in-wrong-folder/15470/4 "2020-02-20T19:51:11Z")

</div>

So it looks like this was actually caused by the Burst package, and they just released a fix:

[https://docs.unity3d.com/Packages/com.unity.burst@1.2/changelog/CHANGELOG.html](https://docs.unity3d.com/Packages/com.unity.burst@1.2/changelog/CHANGELOG.html)

1.2.3: Fix a regression that could break usage of native plugins.

---

<div class="post-metadata">

**Author:** ![grapefrukt](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/grapefrukt/32/1012_2.png) [@grapefrukt](https://qa.fmod.com/u/grapefrukt)\
**Post date:** [March 16, 2020, 8:46am UTC](https://qa.fmod.com/t/player-build-fmodstudiol-dll-not-found-in-wrong-folder/15470/5 "2020-03-16T08:46:10Z")

</div>

I had this issue as well but I’m not using Burst, it did however crop up when I added a package from a git url, not sure how or why that is though.

The quick fix posted above worked for me (post-process copy to correct location) and I don’t have time to properly investigate right now.

---

<div class="post-metadata">

**Author:** ![Harrishun](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/harrishun/32/655_2.png) [@Harrishun](https://qa.fmod.com/u/Harrishun)\
**Post date:** [August 28, 2020, 5:45am UTC](https://qa.fmod.com/t/player-build-fmodstudiol-dll-not-found-in-wrong-folder/15470/6 "2020-08-28T05:45:15Z")

</div>

I’d also like to report that the same issue is happening to me.  
Thanks to @nickstevens000 for that workaround. However, I actually had to keep resonanceaudio in the Plugins folder, strangely.

Currently using: Unity 2019.2.17f1, FMOD 2.01.01

For us, a bunch of Firebase dlls get automatically placed in the Plugins\x86\_64 folder, so I’m wondering why that doesn’t also happen for the FMOD dlls.

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [September 7, 2020, 6:11am UTC](https://qa.fmod.com/t/player-build-fmodstudiol-dll-not-found-in-wrong-folder/15470/7 "2020-09-07T06:11:50Z")

</div>

If you do not already have the FMOD Integration in your project, `Assets/Plugins/FMOD` is the base folder for the plugin and the dlls should be in `Assets/Plugins/FMOD/lib`. Otherwise if you are updating FMOD from a newer .unitypackage, it will find replace the files it finds (using the meta files data) without changing their current location.

---

<div class="post-metadata">

**Author:** ![megaleon](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/megaleon/32/5502_2.png) [@megaleon](https://qa.fmod.com/u/megaleon)\
**Post date:** [August 3, 2023, 4:58pm UTC](https://qa.fmod.com/t/player-build-fmodstudiol-dll-not-found-in-wrong-folder/15470/8 "2023-08-03T16:58:08Z")

</div>

I’m having this issue at the moment with 2021.3.28f1

[20491](https://qa.fmod.com/t/docker-windows-dllnotfoundexception-fmodstudiol/20491)

---

<div class="post-metadata">

**Author:** ![megaleon](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/megaleon/32/5502_2.png) [@megaleon](https://qa.fmod.com/u/megaleon)\
**Post date:** [August 4, 2023, 12:04pm UTC](https://qa.fmod.com/t/player-build-fmodstudiol-dll-not-found-in-wrong-folder/15470/9 "2023-08-04T12:04:25Z")

</div>

I tried something similar to what @nickstevens000 did and I’m doing a copy right before the issue get’s triggered but no difference I still get the same error.

I patched FMODUnity.EventManager just to check if this would fix it but no luck.

For me the issue seems to be triggered in BuildTargetChanged() from FMODUnity when the builds is set on progress.

```auto
public static void CopyFmodToMonoBleeding()
{
	string editorPath = $"{System.IO.Path.GetDirectoryName(EditorApplication.applicationPath)}/Data/MonoBleedingEdge/lib";
	string editorPath64 = $"{editorPath}/x86_64";
	if (!Directory.Exists(editorPath64))
	{
		Directory.CreateDirectory(editorPath64);
		UnityEngine.Debug.Log("Directory created: " + editorPath64);
	}
	string[] paths = { editorPath, editorPath64 };

	UnityEngine.Debug.Log("Unity Editor Path: " + editorPath);

	string libraryPath = $"{Application.dataPath}/Assemblies/Thirdparty/FMOD/platforms/win/lib/x86_64";
	UnityEngine.Debug.Log("FMOD library Path: " + libraryPath);

	DirectoryInfo directoryInfo = new DirectoryInfo(libraryPath);
	FileInfo[] files = directoryInfo.GetFiles("*.dll");

	foreach (var path in paths)
	{
		foreach (FileInfo file in files)
		{
			UnityEngine.Debug.Log("Copy DLL Path: " + file.FullName);

			string sourceFilePath = file.FullName;
			string targetFilePath = $"{path}/{file.Name}";

			if (!File.Exists(targetFilePath))
			{
				try
				{
					File.Copy(sourceFilePath, targetFilePath, true);
					UnityEngine.Debug.Log("DLL file copied to " + targetFilePath);
				}
				catch (IOException ex)
				{
					UnityEngine.Debug.LogError($"Error copying DLL: {ex.Message}");
				}
			}
		}
	}
}

static EventManager()
{
    BuildStatusWatcher.OnBuildStarted += () => {
		if (Application.isBatchMode)
		{
			UnityEngine.Debug.Log("Dirty fix for FMOD");
			CopyFmodToMonoBleeding();
		}
		BuildTargetChanged();
        CopyToStreamingAssets(EditorUserBuildSettings.activeBuildTarget);
    };
    BuildStatusWatcher.OnBuildEnded += () => {
        UpdateBankStubAssets(EditorUserBuildSettings.activeBuildTarget);
    };
}

```

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [August 21, 2023, 1:25am UTC](https://qa.fmod.com/t/player-build-fmodstudiol-dll-not-found-in-wrong-folder/15470/10 "2023-08-21T01:25:26Z")

</div>

It looks like this issue has been resolved in another thread:

> [@Docker Windows “DllNotFoundException: fmodstudioL”](https://qa.fmod.com/t/docker-windows-dllnotfoundexception-fmodstudiol/20491/14):
>
> Nah, we don’t like that conclusion. We believe we’ve got fixes for both the issues you ran into and we’re working to get them into a future release. Thanks for your sleuthing and detailed repro info. Cheers
