Missing debug library on Windows ARM

Hello !

In the Unity integration, I think there is a bug in EditorUtils.cs that causes files located in the staging folder of the unity package not to be copied if a file with the same name doesn’t already exist at the target location.

Lines 1580~

if (EditorUtils.AssetExists(sourcePath))
{
	if (targetPath != null)
	{
		if (!AssetDatabase.DeleteAsset(targetPath))
		{
			RuntimeUtils.DebugLogError(string.Format("FMOD: Could not delete {0}", targetPath));
		}
	}

	targetPath = GetTargetPath(libInfo, Platform.FileLayout.Latest);

	EditorUtils.EnsureFolderExists(EditorUtils.GetParentFolder(targetPath));

	if (!AssetDatabase.CopyAsset(sourcePath, targetPath))
	{
		RuntimeUtils.DebugLogError(string.Format("FMOD: Could not copy {0} to {1}", sourcePath, targetPath));
		allCopiesSucceeded = false;
	}
}

should probably look something like this instead:

if (EditorUtils.AssetExists(sourcePath))
{
	if (targetPath != null)
	{
		if (!AssetDatabase.DeleteAsset(targetPath))
		{
			RuntimeUtils.DebugLogError(string.Format("FMOD: Could not delete {0}", targetPath));
		}
	}
}

targetPath = GetTargetPath(libInfo, Platform.FileLayout.Latest);

EditorUtils.EnsureFolderExists(EditorUtils.GetParentFolder(targetPath));

if (!AssetDatabase.CopyAsset(sourcePath, targetPath))
{
	RuntimeUtils.DebugLogError(string.Format("FMOD: Could not copy {0} to {1}", sourcePath, targetPath));
	allCopiesSucceeded = false;
}

When adding the package to a project (even an empty one), this issue prevents the platforms/win/lib/arm64/fmodstudioL.dll file and its corresponding .meta from being copied from the staging folder, because the file doesn’t originally exist at this location.

This issue might also affect other files in similar circumstances.

Thank you for your consideration on this matter.
Best regards

Both of your code snippets are exactly the same.

The issue I’m seeing is that the FMOD Setup Wizard does not pop back up to continue the process of copying the libs to the correct place. If you restart Unity do you get the Setup Wizard?

Hello !

You’re right, I completely misinterpreted the code and the origin of the issue.
I retested and this is what actually happens :

The package contains the platforms/win/arm/fmodstudio.dll file but not the platforms/win/arm/fmodstudioL.dll file which is copied from the staging folder when the package is installed.

But for versions of Unity before 2023.1, the code doesn’t list the ARM debug library in StagingSystem.LibrariesToUpdate (in EditorUtils.cs), so this file is not copied.

If you then upgrade your project to a newer version of Unity, the library remains missing.
Trying to build a development build triggers this error :

Error building Player: BuildFailedException: There is an FMOD binary missing for build target StandaloneWindows64 (development build):

  • Assets/Plugins/FMOD/platforms/win/lib/arm64/fmodstudioL.dll
    Please run the FMOD/Reorganize Plugin Files menu command.

You then need to reinstall the package in order to properly import the missing DLL file.

I think this is fine for most cases but it would probably be better to either put both DLL files in the staging folder or both DLL files directly in their target folder in the package.

1 Like