Can't build/run WebGL

FMOD 2.00.07 / Unity 2019.2.18f1

Hey, ever since integrating FMOD I’m unable to build for WebGL. A release build compiles and runs, but gets stuck 90% of the way into the loading screen, and a development build doesn’t compile at all. Where do I get started with this?

Release build browser console output:

[UnityCache] 'http://localhost:58544/Build/debug.wasm.framework.unityweb' successfully downloaded and stored in the indexedDB cache [UnityLoader.js:4:13333](http://localhost:58544/Build/UnityLoader.js)

[UnityCache] 'http://localhost:58544/Build/debug.wasm.code.unityweb' successfully downloaded and stored in the indexedDB cache [UnityLoader.js:4:13333](http://localhost:58544/Build/UnityLoader.js)

[UnityCache] 'http://localhost:58544/Build/debug.data.unityweb' successfully downloaded and stored in the indexedDB cache [UnityLoader.js:4:13333](http://localhost:58544/Build/UnityLoader.js)

failed to asynchronously prepare wasm: LinkError: import object field '__ZN4FMODU7gGlobalE' is not a Number [UnityLoader.js:4:11145](http://localhost:58544/Build/UnityLoader.js)

printErr http://localhost:58544/Build/UnityLoader.js:4

instantiateArrayBuffer blob:http://localhost:58544/f606791b-ad57-4022-bb88-d3db3bf69060:8

LinkError: "import object field '__ZN4FMODU7gGlobalE' is not a Number" [UnityLoader.js:4:11108](http://localhost:58544/Build/UnityLoader.js)

LinkError: "import object field '__ZN4FMODU7gGlobalE' is not a Number" [UnityLoader.js:4:11145](http://localhost:58544/Build/UnityLoader.js)

printErr http://localhost:58544/Build/UnityLoader.js:4

onAbort http://localhost:58544/Build/UnityLoader.js:4

abort blob:http://localhost:58544/f606791b-ad57-4022-bb88-d3db3bf69060:8

instantiateArrayBuffer blob:http://localhost:58544/f606791b-ad57-4022-bb88-d3db3bf69060:8

uncaught exception: abort({}) at jsStackTrace@blob:http://localhost:58544/f606791b-ad57-4022-bb88-d3db3bf69060:8:22313 stackTrace@blob:http://localhost:58544/f606791b-ad57-4022-bb88-d3db3bf69060:8:22484 onAbort@http://localhost:58544/Build/UnityLoader.js:4:11047 abort@blob:http://localhost:58544/f606791b-ad57-4022-bb88-d3db3bf69060:8:673613 instantiateArrayBuffer/<@blob:http://localhost:58544/f606791b-ad57-4022-bb88-d3db3bf69060:8:31339

Development build Unity editor console output:

Failed running “C:/Program Files/Unity/Hub/Editor/2019.2.18f1/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\Emscripten_Win\python\2.7.5.3_64bit\python.exe” -E “C:/Program Files/Unity/Hub/Editor/2019.2.18f1/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\Emscripten\emcc” @“C:\Workspace\pawnbarian\Assets..\Temp\emcc_arguments.resp”

stdout:
stderr:warning: unexpected number of arguments 1 in call to ‘__cxa_pure_virtual’, should be 0warning: unexpected number of arguments 2 in call to ‘_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv’, should be 0warning: unexpected number of arguments 4 in call to ‘_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv’, should be 0warning: unexpected number of arguments 5 in call to ‘_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv’, should be 0warning: unexpected number of arguments 4 in call to ‘_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv’, should be 0warning: unexpected number of arguments 2 in call to ‘_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv’, should be 0warning: unexpected number of arguments 3 in call to ‘_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv’, should be 0error: unresolved symbol: FMOD5_ChannelGroup_AddDSPerror: unresolved symbol: FMOD5_ChannelGroup_AddFadePointerror: unresolved symbol: FMOD5_ChannelGroup_AddGrouperror: unresolved symbol: FMOD5_ChannelGroup_Get3DAttributes
[a gazillion more lines about FMOD5 unresolved symbols truncated]

Hi ,
Currently we think there is an issue with the 2.00.07 release of FMOD for HTML5 unity, which we are working on.
Can you try 2.00.06 and see if that helps?

Hey, thank you!

I downgraded FMOD to 2.00.06 and upgraded Unity to 2019.3.1f1. Both release and debug (using L version of the plugin) builds seem to work fine.

Downgrading FMOD but sticking with Unity 2019.2.18f1 brought its own issues. Editor playmode started spewing out an error every few seconds. A cursory glance at the diffs showed it’s something related to the way assets are copied over? Not an issue for me going forward, but I’ll paste the stack trace for reference.

ArgumentException: The specified path is not of a legal form (empty).
System.IO.Path.InsecureGetFullPath (System.String path) (at <567df3e0919241ba98db88bec4c6696f>:0)
System.IO.Path.GetFullPathInternal (System.String path) (at <567df3e0919241ba98db88bec4c6696f>:0)
System.IO.FileInfo.Init (System.String fileName, System.Boolean checkHost) (at <567df3e0919241ba98db88bec4c6696f>:0)
System.IO.FileInfo..ctor (System.String fileName) (at <567df3e0919241ba98db88bec4c6696f>:0)
(wrapper remoting-invoke-with-check) System.IO.FileInfo..ctor(string)
UnityEditor.VisualStudioIntegration.SolutionSynchronizer.ShouldSyncOnReimportedAsset (System.String asset) (at C:/buildslave/unity/build/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:224)
System.Linq.Enumerable.Any[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
UnityEditor.VisualStudioIntegration.SolutionSynchronizer.SyncIfNeeded (System.Collections.Generic.IEnumerable`1[T] affectedFiles, System.Collections.Generic.IEnumerable`1[T] reimportedFiles) (at C:/buildslave/unity/build/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:213)
UnityEditor.SyncVS.PostprocessSyncProject (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromAssetPaths) (at C:/buildslave/unity/build/Editor/Mono/SyncProject.cs:165)
UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets) (at C:/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:159)
UnityEditor.AssetDatabase:SaveAssets()
FMODUnity.EventManager:CopyToStreamingAssets() (at Assets/Plugins/FMOD/src/Editor/EventManager.cs:584)
FMODUnity.EventManager:RefreshBanks() (at Assets/Plugins/FMOD/src/Editor/EventManager.cs:37)
FMODUnity.EventManager:Update() (at Assets/Plugins/FMOD/src/Editor/EventManager.cs:656)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:303)