# StreamingAssets fail to copy due to invalid path name in EventManager.cs (upgrade to 2.00.00 integration)

**URL:** https://qa.fmod.com/t/streamingassets-fail-to-copy-due-to-invalid-path-name-in-eventmanager-cs-upgrade-to-2-00-00-integration/14479
**Category:** Unity
**Created:** [March 24, 2019, 8:52am UTC](https://qa.fmod.com/t/streamingassets-fail-to-copy-due-to-invalid-path-name-in-eventmanager-cs-upgrade-to-2-00-00-integration/14479 "2019-03-24T08:52:06Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![studioatmazeke](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@studioatmazeke](https://qa.fmod.com/u/studioatmazeke)
#### Post date: [March 24, 2019, 8:52am UTC](https://qa.fmod.com/t/streamingassets-fail-to-copy-due-to-invalid-path-name-in-eventmanager-cs-upgrade-to-2-00-00-integration/14479/1 "2019-03-24T08:52:06Z")

</div>

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.

These are the errors from Unity:

```
FMOD Studio: copy banks for platform Windows : copying banks from Assets\FMODAssets\Desktop to D:/Repos/MyGame/MyGame/Assets/StreamingAssets
UnityEngine.Debug:LogError(Object)
FMODUnity.EventManager:CopyToStreamingAssets() (at Assets/3rdParty/Editor/Plugins/FMOD/src/Editor/EventManager.cs:555)
FMODUnity.EventManager:OnCacheChange() (at Assets/3rdParty/Editor/Plugins/FMOD/src/Editor/EventManager.cs:597)
FMODUnity.EventManager:Update() (at Assets/3rdParty/Editor/Plugins/FMOD/src/Editor/EventManager.cs:609)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

IOException: Win32 IO returned ERROR_INVALID_NAME. Path: D:\Repos\MyGame\MyGame\Assets\StreamingAssetsD:
System.IO.Directory.CreateDirectoriesInternal (System.String path) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
System.IO.Directory.CreateDirectory (System.String path) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
System.IO.DirectoryInfo.Create () (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
(wrapper remoting-invoke-with-check) System.IO.DirectoryInfo.Create()
System.IO.Directory.CreateDirectoriesInternal (System.String path) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
System.IO.Directory.CreateDirectory (System.String path) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
System.IO.DirectoryInfo.Create () (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
(wrapper remoting-invoke-with-check) System.IO.DirectoryInfo.Create()
System.IO.Directory.CreateDirectoriesInternal (System.String path) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
System.IO.Directory.CreateDirectory (System.String path) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
System.IO.DirectoryInfo.Create () (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
(wrapper remoting-invoke-with-check) System.IO.DirectoryInfo.Create()
System.IO.Directory.CreateDirectoriesInternal (System.String path) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
System.IO.Directory.CreateDirectory (System.String path) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
System.IO.DirectoryInfo.Create () (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
(wrapper remoting-invoke-with-check) System.IO.DirectoryInfo.Create()
FMODUnity.EventManager.CopyToStreamingAssets () (at Assets/3rdParty/Editor/Plugins/FMOD/src/Editor/EventManager.cs:538)
UnityEngine.Debug:LogException(Exception)
FMODUnity.EventManager:CopyToStreamingAssets() (at Assets/3rdParty/Editor/Plugins/FMOD/src/Editor/EventManager.cs:556)
FMODUnity.EventManager:OnCacheChange() (at Assets/3rdParty/Editor/Plugins/FMOD/src/Editor/EventManager.cs:597)
FMODUnity.EventManager:Update() (at Assets/3rdParty/Editor/Plugins/FMOD/src/Editor/EventManager.cs:609)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
```

---

<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: [March 25, 2019, 11:33pm UTC](https://qa.fmod.com/t/streamingassets-fail-to-copy-due-to-invalid-path-name-in-eventmanager-cs-upgrade-to-2-00-00-integration/14479/2 "2019-03-25T23:33:04Z")

</div>

Thanks for reporting this. We have found and fixed the problem for the next release.

In the meantime you can find the fix on our Github:

> <https://github.com/fmod/UnityIntegration/commit/c0106f3ae68add393a4080ea42c4eca1d6266150>

---

<div class="post-metadata">

### Author: ![studioatmazeke](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@studioatmazeke](https://qa.fmod.com/u/studioatmazeke)
#### Post date: [March 26, 2019, 1:23am UTC](https://qa.fmod.com/t/streamingassets-fail-to-copy-due-to-invalid-path-name-in-eventmanager-cs-upgrade-to-2-00-00-integration/14479/3 "2019-03-26T01:23:18Z")

</div>

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.

---

<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: [March 26, 2019, 2:35am UTC](https://qa.fmod.com/t/streamingassets-fail-to-copy-due-to-invalid-path-name-in-eventmanager-cs-upgrade-to-2-00-00-integration/14479/4 "2019-03-26T02:35:44Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![studioatmazeke](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@studioatmazeke](https://qa.fmod.com/u/studioatmazeke)
#### Post date: [March 26, 2019, 4:01am UTC](https://qa.fmod.com/t/streamingassets-fail-to-copy-due-to-invalid-path-name-in-eventmanager-cs-upgrade-to-2-00-00-integration/14479/5 "2019-03-26T04:01:22Z")

</div>

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)
```

---

<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: [March 26, 2019, 4:45am UTC](https://qa.fmod.com/t/streamingassets-fail-to-copy-due-to-invalid-path-name-in-eventmanager-cs-upgrade-to-2-00-00-integration/14479/6 "2019-03-26T04:45:50Z")

</div>

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.

---

<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: [March 28, 2019, 12:46am UTC](https://qa.fmod.com/t/streamingassets-fail-to-copy-due-to-invalid-path-name-in-eventmanager-cs-upgrade-to-2-00-00-integration/14479/7 "2019-03-28T00:46:50Z")

</div>

Thanks for your patience, I believe we have a fix for the issue:

> <https://github.com/fmod/UnityIntegration/commit/00d3db83ed630522439e979a7f2af9ccb0019385>

---

<div class="post-metadata">

### Author: ![studioatmazeke](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@studioatmazeke](https://qa.fmod.com/u/studioatmazeke)
#### Post date: [March 28, 2019, 9:08pm UTC](https://qa.fmod.com/t/streamingassets-fail-to-copy-due-to-invalid-path-name-in-eventmanager-cs-upgrade-to-2-00-00-integration/14479/8 "2019-03-28T21:08:11Z")

</div>

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:

```
Name:"D:\\Repos\\Gravastar\\Gravastar\\\\Battle-Baird"
Path:"D:\\Repos\\Gravastar\\Gravastar\\Assets\\FMODAssets\\Desktop\\Battle-Baird.bank"
SubDir:"D:\\Repos\\Gravastar\\Gravastar\\"

```

Let me know if there’s anything else I can provide to help troubleshoot. I deleted the cache and refreshed banks to test this.

---

<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: [April 1, 2019, 11:19pm UTC](https://qa.fmod.com/t/streamingassets-fail-to-copy-due-to-invalid-path-name-in-eventmanager-cs-upgrade-to-2-00-00-integration/14479/9 "2019-04-01T23:19:54Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![studioatmazeke](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@studioatmazeke](https://qa.fmod.com/u/studioatmazeke)
#### Post date: [April 2, 2019, 12:06am UTC](https://qa.fmod.com/t/streamingassets-fail-to-copy-due-to-invalid-path-name-in-eventmanager-cs-upgrade-to-2-00-00-integration/14479/10 "2019-04-02T00:06:04Z")

</div>

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:

```auto
  MasterBanks:
  - \Master
  Banks:
  - \Battle-Baird
  - \Battle-Criddler

```

---

<div class="post-metadata">

### Author: ![studioatmazeke](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@studioatmazeke](https://qa.fmod.com/u/studioatmazeke)
#### Post date: [April 2, 2019, 12:16am UTC](https://qa.fmod.com/t/streamingassets-fail-to-copy-due-to-invalid-path-name-in-eventmanager-cs-upgrade-to-2-00-00-integration/14479/11 "2019-04-02T00:16:36Z")

</div>

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.

---

<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: [April 2, 2019, 4:45am UTC](https://qa.fmod.com/t/streamingassets-fail-to-copy-due-to-invalid-path-name-in-eventmanager-cs-upgrade-to-2-00-00-integration/14479/12 "2019-04-02T04:45:45Z")

</div>

The Build Path is the one that gets serialized, the other one is then calculated for that particular machine using the Build Path.

I also fixed up the leading ‘\’ in the bank names in the settings.

> <https://github.com/fmod/UnityIntegration/commit/b69dfe74b2920af6001382008f9c4d4aa9f15ee9>

---

<div class="post-metadata">

### Author: ![Katrol](https://avatars.discourse-cdn.com/v4/letter/k/c6cbf5/32.png) [@Katrol](https://qa.fmod.com/u/Katrol)
#### Post date: [April 2, 2019, 11:11am UTC](https://qa.fmod.com/t/streamingassets-fail-to-copy-due-to-invalid-path-name-in-eventmanager-cs-upgrade-to-2-00-00-integration/14479/13 "2019-04-02T11:11:39Z")

</div>

today,I update our project,the same problem has happened.There are some screenshots before using fixes

 ![fomdbug](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/1X/1c4df60697e76850ff9f7886ab051a26c19beabb.png) ![fmod](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/1X/80b81e6c84526b19bf0dc0ac07b38f5a0fb90101.png) .And these are some screenshots after using fixed  
code ![bug_new](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/1X/7a408a8750d0d72d0a17a09ea85e35de938eaa07.png) ![bugnew2](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/1X/4c74e75e129e3effe45af3bbd7569526f8bf39cc.png)

---

<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: [April 2, 2019, 9:52pm UTC](https://qa.fmod.com/t/streamingassets-fail-to-copy-due-to-invalid-path-name-in-eventmanager-cs-upgrade-to-2-00-00-integration/14479/14 "2019-04-02T21:52:12Z")

</div>

When you say you updated the project, have you also included the changes made in our Github repo?

---

<div class="post-metadata">

### Author: ![studioatmazeke](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@studioatmazeke](https://qa.fmod.com/u/studioatmazeke)
#### Post date: [April 2, 2019, 11:18pm UTC](https://qa.fmod.com/t/streamingassets-fail-to-copy-due-to-invalid-path-name-in-eventmanager-cs-upgrade-to-2-00-00-integration/14479/15 "2019-04-02T23:18:44Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![Katrol](https://avatars.discourse-cdn.com/v4/letter/k/c6cbf5/32.png) [@Katrol](https://qa.fmod.com/u/Katrol)
#### Post date: [April 3, 2019, 2:28am UTC](https://qa.fmod.com/t/streamingassets-fail-to-copy-due-to-invalid-path-name-in-eventmanager-cs-upgrade-to-2-00-00-integration/14479/16 "2019-04-03T02:28:31Z")

</div>

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:

---

<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: [April 3, 2019, 2:45am UTC](https://qa.fmod.com/t/streamingassets-fail-to-copy-due-to-invalid-path-name-in-eventmanager-cs-upgrade-to-2-00-00-integration/14479/17 "2019-04-03T02:45:39Z")

</div>

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.
