Unable to load banks on android build

Hi there,

I’m using Unity 2020.3.19f1 with Fmod 2.02.03. Audio seems to work as expected in Editor but I get no audio at all on Android builds. This is the error I get in build:

2021-11-09T12:30:09.3484180+00:00 [EXCEPTION] BankLoadException: [FMOD] Could not load bank ‘file:///android_asset/Master.bank’ : ERR_PLUGIN_MISSING : A requested output, dsp unit type or codec was not available.
FMODUnity.RuntimeManager.loadedBankRegister (FMODUnity.RuntimeManager+LoadedBank loadedBank, System.String bankPath, System.String bankName, System.Boolean loadSamples, FMOD.RESULT loadResult) (at <00000000000000000000000000000000>:0)
FMODUnity.RuntimeManager.LoadBank (System.String bankName, System.Boolean loadSamples) (at <00000000000000000000000000000000>:0)
FMODUnity.RuntimeManager.LoadBanks (FMODUnity.Settings fmodSettings) (at <00000000000000000000000000000000>:0)
FMODUnity.RuntimeManager.Initialize () (at <00000000000000000000000000000000>:0)
FMODUnity.RuntimeManager.get_Instance () (at <00000000000000000000000000000000>:0)
FMODUnity.RuntimeManager.get_StudioSystem () (at <00000000000000000000000000000000>:0)
FMODUnity.RuntimeManager.AddListener (FMODUnity.StudioListener listener) (at <00000000000000000000000000000000>:0)
FMODUnity.StudioListener.OnEnable () (at <00000000000000000000000000000000>:0)

So it seems like the bank can’t be loaded. The fmod project is almost empty and I’m not using any plugins other than the usual standard reverb return.

Maybe this is related to the plugin structure? The documentation shows a certain structure using a “lib” folder under Assets/Plugins/FMOD (see the bottom of the screenshot here: https://www.fmod.com/resources/documentation-unity?version=2.02&page=plugins.html#dynamic-plugins) but the fmod plugin installer install things in a different way (on a platform folder). Tried to manually change this to the old structure but the project doesn’t compile if I do.

I also wonder if I have to add any static or dynamic plugins. I’m not using any additional plugins on the fmod project as I mentioned before but I’m not sure if I need to add anything there.

I changed the logging level to Log but I don’t see more information about which plugin is missing.

Lastly, maybe this is related to the output or codec? I’m using the “Auto” output on the Android build FMOD settings in Unity and the usual FADPCM on the build settings in Fmod Studio.

Any ideas?

Did a Windows build and I’m getting exactly the same error too. Tried also to do a local build (non Jenkins) and I’m seeing this:

FMOD Studio: copy banks for platform Windows : copying banks from FMODAssets/Desktop to .../Assets/StreamingAssets succeeded
UnityEngine.Debug:LogFormat (string,object[])
FMODUnity.RuntimeUtils:DebugLogFormat (string,object[]) (at Assets/Plugins/FMOD/src/RuntimeUtils.cs:521)
FMODUnity.EventManager:CopyToStreamingAssets (UnityEditor.BuildTarget) (at Assets/Plugins/FMOD/src/Editor/EventManager.cs:820)
FMODUnity.EventManager/<>c:<Startup>b__15_0 () (at Assets/Plugins/FMOD/src/Editor/EventManager.cs:535)
FMODUnity.BuildStatusWatcher:SetBuildInProgress (bool) (at Assets/Plugins/FMOD/src/Editor/EditorUtils.cs:1461)
FMODUnity.BuildStatusWatcher/BuildProcessor:OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport) (at Assets/Plugins/FMOD/src/Editor/EditorUtils.cs:1487)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

FMOD: Selected binaries for platform StandaloneWindows64:
- Enabled Assets/Plugins/FMOD/platforms/win/lib/x86_64/fmodstudio.dll
- Enabled Assets/Plugins/FMOD/platforms/win/lib/x86_64/resonanceaudio.dll
- Disabled Assets/Plugins/FMOD/platforms/win/lib/x86_64/fmodstudioL.dll
UnityEngine.Debug:Log (object)
FMODUnity.RuntimeUtils:DebugLog (string) (at Assets/Plugins/FMOD/src/RuntimeUtils.cs:513)
FMODUnity.Settings:SelectBinaries (FMODUnity.Platform,UnityEditor.BuildTarget,FMODUnity.Platform/BinaryType) (at Assets/Plugins/FMOD/src/Settings.cs:1195)
FMODUnity.Settings:PreprocessBuild (UnityEditor.BuildTarget,FMODUnity.Platform/BinaryType) (at Assets/Plugins/FMOD/src/Settings.cs:1082)
FMODUnity.Settings/BuildProcessor:OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport) (at Assets/Plugins/FMOD/src/Settings.cs:1225)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

So it seems like things are been copied correctly and the FMOD plugin is failing at some point?

Maybe try adding “resonanceaudio” to the Dynamic Plugin List? You shouln’t need to do it if you aren’t using resonance audio plugins though. Maybe also check you haven’t enabled “Split Application Binary” in the Android player settings?

That image you are referring is outdated, I’ll make a task to update it.

Hi, tried adding resonanceaudio to the Dynamic Plugin list but I’m still getting the same error. I checked and “Split Application Binary” is not enabled on the project.

Also tried removing the platform groups and just having the platforms (Android and Windows) directly but no luck. I still get the same error, “ERR_PLUGIN_MISSING” on both Android and Windows.

Is there anything else I can try? Attaching a screenshot of the plugin folder within Fmod Studio installation. What is fmod_output_controller? And should I remove plugins that I’m not using?

It seems like the problem is that the build machine is still grabbing the old banks from the old Unity project this one comes from. I’m trying to understand why this happens but it seems like at some point the StreamingAssets folder is populated with the wrong banks which DID use a plugin that is now missing, hence the error.

I see, maybe double check the bank path in the FMOD settings on your build machine? That or set the Source Type to “FMOD Studio Project”, set the Studio Project Path to “<path_to>/<my_project>.fspro” and rebuild your banks in FMOD Studio.

Thanks for your answer. At the end, the issue was related to how the building process manages the StreamingAssets folder. Some code wizardy was happening there for build optimization and I wasn’t aware of it.

First, we made sure the building machines were deleting the old banks. After doing this, the “ERR_PLUGIN_MISSING” error was replaced by “ERR_FILE_MISSING”. This makes sense. Since the old FMOD project was using the Oculus Spatializer, the new buid was complaining the plugin wasn’t there.

After making sure the old banks got deleted FMOD could not find any banks at all so we added a call to EventManager.CopyToStremingAssets() just after the old bank clean up code lines. That did the trick and now the builds on both Android and Windows use the proper, current banks.