This is an error we started getting in Unity 2018.3.7f1 after upgrading to FMOD 2.00.00 from 1.10.11. It appears to happen when the banks are copied (unsuccessfully) to the StreamingAssets folder. From my digging, it seems that this has something to do with some of the paths of the banks in EventManager.cs being stored as absolute paths and not relative. This doesn’t seem to be an issue with the Master.strings.bank for some reason.
The Path for Master.strings is “Assets\FMODAssets\Desktop\Master.strings.bank” while the path for the next bank in the list is “D:\Repos\MyGame\MyGame\Assets\FMODAssets\Desktop\Battle.bank”. This causes the subDir variable on line 525 of EventManager.cs to provide an improper value and thus create invalid Paths on the next lines.
Please let me know if I can provide any additional information.
Thanks for the quick reply @cameron-fmod . I went ahead and updated our code with the fix on GitHub but I’m still seeing the same errors on my end. Let me know if there’s any additional info I can provide.
Can you try deleting the FMODStudioCache.asset and then refreshing the banks.
This won’t destroy anything, it will be recreated when the new banks a reloaded.
Same errors after deleting deleting FMODStudioCache.asset and refreshing the banks. I also tried deleting the contents of the StreamingAssets folder just in case, but it didn’t change anything.
The first time after refreshing banks from the FMOD menu in Unity, I get this error as well (not sure if it’s related):
FMOD Studio: Unable to load Master.strings: The specified bank has already been loaded.
UnityEngine.Debug:LogError(Object)
FMODUnity.EventManager:UpdateCacheBank(EditorBankRef) (at Assets/3rdParty/Editor/Plugins/FMOD/src/Editor/EventManager.cs:462)
FMODUnity.EventManager:UpdateCache() (at Assets/3rdParty/Editor/Plugins/FMOD/src/Editor/EventManager.cs:306)
FMODUnity.EventManager:RefreshBanks() (at Assets/3rdParty/Editor/Plugins/FMOD/src/Editor/EventManager.cs:36)
Apologies, this is a slightly different bug to the one I mentioned the fix for.
I’m working on this at the moment and will get back to you once I have found the ‘nicest’ fix.
Still coming back with the same error. I think it has to do with the bankRef.Name of the second bank in eventCache.EditorBanks returning the entire path. It has the right Name at initialization, but after the foreach (var bankRef in eventCache.EditorBanks) on line 526 loops the second time, the path changes to the incorrect string for some reason.
This is from the Unity Debugger after it updates to the wrong value:
Thanks very much for helping us with this issue by the way.
Does this only occur if you manually type in the project/build path in the settings?
If you use the ‘Browse’ button to find the folder, does this use the correct paths?
You are correct. We are using a Multiple Platform Build and I had defined the Build Path as Assets\FMODAssets. When I used the browse button to select the same folder, there is now a new field below Build Path that loads a greyed out version of the full path labeled as the “Platform specific path”. The Build Path still shows Assets\FMODAssets, but the StreamingAssets are correctly loading without the IOException now.
Will this cause issues in source control, since the “Platform specific path” field is using the absolute path for my machine specifically? Or will this load the proper path for my teammates on their machines?
I also noticed that the FMODStudioSettings.asset now lists the banks with a slash in front of them:
Also, will my teammates need to delete their local FMODStudioCache.asset and browse to the path manually on their local repos as well, or will this propagate through source control? We don’t have the FMODStudioCache.asset stored in the repo, due to the source control suggestions from the FMOD best practices page.
This appears to be working for me with the most recent fixes from GitHub. I still need to see if the changes propagate to our other team-members properly, but I’ll monitor as we move forward to see if anything else crops up. Thanks for the assistance @cameron-fmod!
I remove all files under the StreamingAssets file,and the operation copying banks successed.Should I update my project from 1.10 to 2.0. I am worried about the problems that will occur:rofl:
A new patch version should be coming out in the next week, this will contain the fix for this issue as well as some others.
Keep in mind that 2.0 is in ‘early access’ and will no doubt have some teething issues, although it will also have features that the older, more stable versions do not.