# \[Bug\] Banks in addressable are not build correclty using Unity Cloud Build

**URL:** <https://qa.fmod.com/t/bug-banks-in-addressable-are-not-build-correclty-using-unity-cloud-build/19627>\
**Category:** Unity\
**Created:** [December 7, 2022, 11:35am UTC](https://qa.fmod.com/t/bug-banks-in-addressable-are-not-build-correclty-using-unity-cloud-build/19627 "2022-12-07T11:35:14Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![UncommonGames](https://avatars.discourse-cdn.com/v4/letter/u/bb73d2/32.png) [@UncommonGames](https://qa.fmod.com/u/UncommonGames)\
**Post date:** [December 7, 2022, 11:35am UTC](https://qa.fmod.com/t/bug-banks-in-addressable-are-not-build-correclty-using-unity-cloud-build/19627/1 "2022-12-07T11:35:14Z")

</div>

Hello,

We are using addressable with FMOD. When we make a manual build it’s working well but when building on Unity Cloud Build (UCB). It seems that the addressable build do not convert the stub banks into real banks data because the final size of the addressable group is too small. And at runtime I have this error:  
Error Unity BankLoadException: [FMOD] Could not load bank ‘Master’ : ERR\_FORMAT : Unsupported file or audio format.

Maybe PostDependencyCallback and PostWritingCallback are not working properly for a reason with UCB?  
I also had the issues with manual build on Mac the first time I build it. But it generated it correctly the second time without a reason.

Do you have a solution or an idea for this?  
Or is it possible to force to build with some lines of code the real bank data to replace the stubs?

Unity version: 2021.3.2f1  
Addressable version: 1.19.19 (I tried with 1.21.1)  
Fmod version: v2.02.09

Thanks in advance

---

<div class="post-metadata">

**Author:** ![UncommonGames](https://avatars.discourse-cdn.com/v4/letter/u/bb73d2/32.png) [@UncommonGames](https://qa.fmod.com/u/UncommonGames)\
**Post date:** [December 8, 2022, 2:39pm UTC](https://qa.fmod.com/t/bug-banks-in-addressable-are-not-build-correclty-using-unity-cloud-build/19627/2 "2022-12-08T14:39:21Z")

</div>

Ok I solved it. We build Addressables with UCB settings, so they were pre build outside the normal build process that fmod is registered by default. So the stub were not replaced at the correct time. We added EventManager.CopyToStreamingAssets(buildTarget)  
and EventManager.UpdateBankStubAssets(buildTarget) to make it work for UCB.

---

<div class="post-metadata">

**Author:** ![CineTek](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@CineTek](https://qa.fmod.com/u/CineTek)\
**Post date:** [January 23, 2023, 9:56pm UTC](https://qa.fmod.com/t/bug-banks-in-addressable-are-not-build-correclty-using-unity-cloud-build/19627/3 "2023-01-23T21:56:45Z")

</div>

At which point in the process do you do those two calls if I may ask?  
Do you call both before building addressables?

---

<div class="post-metadata">

**Author:** ![CineTek](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@CineTek](https://qa.fmod.com/u/CineTek)\
**Post date:** [January 25, 2023, 2:30pm UTC](https://qa.fmod.com/t/bug-banks-in-addressable-are-not-build-correclty-using-unity-cloud-build/19627/4 "2023-01-25T14:30:40Z")

</div>

To make addressables build, the RefreshBanks() call is vital in batchmode so maybe that should be added to the Addressables documentation

```auto
Debug.Log("FMOD: Refresh banks");
        EventManager.RefreshBanks();

        Debug.Log("FMOD: copy to Streaming assets");
        BuildTarget buildTarget = EditorUserBuildSettings.activeBuildTarget;
        EventManager.CopyToStreamingAssets(buildTarget);

        AddressableAssetSettings.BuildPlayerContent(out AddressablesPlayerBuildResult result);
        Debug.Log("FMOD: Building bankStub assets");
        EventManager.UpdateBankStubAssets(buildTarget);

```

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [February 2, 2023, 11:38pm UTC](https://qa.fmod.com/t/bug-banks-in-addressable-are-not-build-correclty-using-unity-cloud-build/19627/5 "2023-02-02T23:38:19Z")

</div>

Thanks to for pointing this out @UncommonGames and @CineTek - glad to hear you managed to find a workaround. I’ve passed your information along to the dev team to investigate further.

---

<div class="post-metadata">

**Author:** ![Maligan](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@Maligan](https://qa.fmod.com/u/Maligan)\
**Post date:** [February 4, 2023, 9:12am UTC](https://qa.fmod.com/t/bug-banks-in-addressable-are-not-build-correclty-using-unity-cloud-build/19627/6 "2023-02-04T09:12:10Z")

</div>

I’ve traced the problem (I’m using cloud build [with game-ci](https://github.com/game-ci/unity-builder/blob/501c67e40cf144812c33bf3e883864938410510a/dist/default-build-script/Assets/Editor/UnityBuilderAction/Builder.cs))

`BuildStatusWatcher.Startup()` doesn’t call during cloud build, so bank stubs aren’t replaced with real assets, because event of addressables build isn’t caught properly by fmod.

I’ve tried to move this setup call from:  
`EditorUtils.CallStartupMethodsWhenReady()`  
to:  
`EditorUtils.Startup()`  
And this fix cloud build.

* * *

I don’t know how it should work but the fact:

- unity rise build event
- fmod editor utils hasn’t subscribed at that moment it occurs

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [February 5, 2023, 10:14pm UTC](https://qa.fmod.com/t/bug-banks-in-addressable-are-not-build-correclty-using-unity-cloud-build/19627/7 "2023-02-05T22:14:54Z")

</div>

Thanks for providing some more info, I’ve passed this along to the dev team as well.

---

<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 7, 2023, 7:24am UTC](https://qa.fmod.com/t/bug-banks-in-addressable-are-not-build-correclty-using-unity-cloud-build/19627/8 "2023-08-07T07:24:31Z")

</div>

@UncommonGames

I’m having an issue with Fmod at the moment. Part of the issue might be related to the docker image I’m using.

Could you maybe share for which platform were you building?

@Maligan which game-ci image did you use?

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [August 11, 2023, 12:11am UTC](https://qa.fmod.com/t/bug-banks-in-addressable-are-not-build-correclty-using-unity-cloud-build/19627/9 "2023-08-11T00:11:41Z")

</div>

Hi,

I can see that your issue appears to have been handled in another thread: [Docker Windows “DllNotFoundException: fmodstudioL” - #13 by megaleon](https://qa.fmod.com/t/docker-windows-dllnotfoundexception-fmodstudiol/20491/13)

Can you please confirm whether your issue has been resolved?

---

<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 11, 2023, 8:55am UTC](https://qa.fmod.com/t/bug-banks-in-addressable-are-not-build-correclty-using-unity-cloud-build/19627/10 "2023-08-11T08:55:43Z")

</div>

Yes the issue is being handle in other thread.

I just wanted to check weather this was a only Windows issue… which seems to be.

---

<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 30, 2023, 2:05pm UTC](https://qa.fmod.com/t/bug-banks-in-addressable-are-not-build-correclty-using-unity-cloud-build/19627/11 "2023-08-30T14:05:15Z")

</div>

We actually had to switch from AssetBundles to Addressables and we are facing exactly this same issue. What @Maligan states is right the BuildStatusWatcher.Startup() is not being called if you build using batchmode.

My solution was the following as prestep before the build

```auto
Debug.Log("FMOD: Refresh banks");
FMODUnity.EventManager.RefreshBanks();

Debug.Log("FMOD: copy to Streaming assets");
FMODUnity.EventManager.CopyToStreamingAssets(target);

Debug.Log("FMOD: Building bankStub assets");
FMODUnity.EventManager.UpdateBankStubAssets(target);

if(Application.isBatchMode)
{
	FMODUnity.BuildStatusWatcher.Startup();
}

```

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [August 31, 2023, 1:04am UTC](https://qa.fmod.com/t/bug-banks-in-addressable-are-not-build-correclty-using-unity-cloud-build/19627/12 "2023-08-31T01:04:05Z")

</div>

Thanks for the update, and for posting your workaround for other users. For some context, from your other posts it seems that you’re using 2.02.13 - the issue with `BuildStatusWatcher.Startup()` was fixed in 2.02.15. That said, I’m happy to hear that you’ve managed to resolve problem.
