Problem with WebGL building Unity 2018.3.0f2
Hello there, I am trying to build with WebGL but although it loads a lot like it should when it finishes the build folder is completely empty. I have this warning:
Library\PackageCache\com.unity.analytics@3.2.2\DataPrivacy\DataPrivacyButton.cs(28,13): warning CS0618: 'Application.ExternalEval(string)' is obsolete: 'Application.ExternalEval is deprecated. See https://docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html for alternatives.'
And then this huge error that says file not found (the name of the game is MyGame since was for testing):
FileNotFoundException: C:\Users\Windows\Desktop\MyGame\Temp\StagingArea\Data\linkresult_wasm\build.wasm does not exist System.IO.File.Copy (System.String sourceFileName, System.String destFileName, System.Boolean overwrite) (at :0) System.IO.File.Copy (System.String sourceFileName, System.String destFileName) (at :0) UnityEditor.WebGL.WebGlBuildPostprocessor.AssembleOutput (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:665) UnityEditor.WebGL.WebGlBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:956) UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at C:/buildslave/unity/build/Editor/Mono/Modules/DefaultBuildPostprocessor.cs:27) UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:286) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
The weirdest part is that at the end it says building result Sucess for some reason :S
Please if you could help me I've been looking a lot and I don't know what to do, I tried looking at WEBGL: Interacting with browser from Unity scripts but I don't understand anything of what and where should I change.
Answer by CindyEspindola · Jan 15, 2019 at 05:06 PM
I found in another question someone suggested changing from web assembly to asm.js as linker target and then the problem vanishes luckily, but does someone know why can't I use web assembly?
Answer by ChirsGeorge · Mar 21, 2019 at 12:29 PM
I am getting a similar issue on Unity 2018.3.8f1, but it immediately throws the error at the start of the build process. Changing from WebAssembly to asm.js did not work for me. Looking for anymore advice.
I think I may have figured it out. The project I am working on has a rsp file that sets the warnings as errors flags. So when compiling for WebGL it is using a depreciated method for the DataPrivacyButton.cs that is located in the Library folder.
void OpenUrl(string url)
{
interactable = true;
urlOpened = true;
#if UNITY_WEBGL && !UNITY_EDITOR
Application.ExternalEval("window.open(\"" + url + "\",\"_blank\")");
#else
Application.OpenURL(url);
#endif
}
Your answer
Follow this Question
Related Questions
Error when building in WebGL: "UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors" 0 Answers
WEBGL Build Not Working! 0 Answers
[Problem] Unity 5.6.1f1 won't build to WebGL 0 Answers
Unity 2019 webGL build error,Unity 2019 WebGL build error 0 Answers
white screen after build the game for WEBGL,white screen after building the game to WEBGL 0 Answers