Search Unity

Question WebGL Build Error

Discussion in 'Web' started by Psyren198, Mar 24, 2023.

  1. Psyren198

    Psyren198

    Joined:
    Oct 29, 2021
    Posts:
    2
    I'm learning about unity development and I am currently trying to fix this problem that I had since a few months ago where I could not build on webgl and I had the same error messages. I tried searching for other solutions, and I could not find one that helped me resolve mine. I've tried deleting the files and it still have some errors. I haven't tried to uninstall and re-install as I want to try and resolve these errors.

    I am using unity version 2021.3.21f1. These errors are from an empty project.

    Error 1:
    Building Library\Bee\artifacts\WebGL\build\debug_WebGL_wasm\build.js failed with output:
    emcc2: error: C:\Users\HAKIM~1\\AppData\\Local\\Temp\\tmpr96227aqGameAssembly.a
    C:\\Users\\HAKIM~1\AppData\Local\Temp\tmpy7dii2qtWebGLSupport_AccessibilityModule_Dynamic.a: No such file or directory ("C:\Users\HAKIM~1\\AppData\\Local\\Temp\\tmpr96227aqGameAssembly.a
    C:\\Users\\HAKIM~1\AppData\Local\Temp\tmpy7dii2qtWebGLSupport_AccessibilityModule_Dynamic.a" was expected to be an input file, based on the commandline arguments provided)
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)

    Error 2:
    BuildFailedException: Incremental Player build failed!
    UnityEditor.Modules.BeeBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <57a8ad0d1492436d8cfee9ba8e6618f8>:0)
    UnityEditor.WebGL.WebGlBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/bokken/build/output/unity/unity/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:179)
    UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <57a8ad0d1492436d8cfee9ba8e6618f8>:0)
    UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.Int32 subtarget, 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 <57a8ad0d1492436d8cfee9ba8e6618f8>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)

    Error 3:
    Build completed with a result of 'Failed' in 59 seconds (59444 ms)
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)

    Error 4:
    UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <57a8ad0d1492436d8cfee9ba8e6618f8>:0
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <57a8ad0d1492436d8cfee9ba8e6618f8>:0
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)

    Can someone please help me resolve this issue.
     
  2. unityruba

    unityruba

    Unity Technologies

    Joined:
    Nov 6, 2020
    Posts:
    273
    Hello!

    1. is this just an empty project that you haven't modified at all?
    2. the first error is the relevant one here, the others are failures due to that top one, you can see the entire logs (and even attach the log file here which you can find in the directories listed here https://docs.unity3d.com/Manual/LogFiles.html)
    2. could you try deleting the Bee artifacts directory Library\Bee\artifacts\ and rebuilding? artifacts from previous builds can mess up future ones
     
  3. Psyren198

    Psyren198

    Joined:
    Oct 29, 2021
    Posts:
    2
    Hello Ruba,

    These particular errors are from an empty project. I also made another project with just a 2D square sprite, and it gave the same errors.

    I tried deleting the Bee artifacts directory, and it still shows the same errors as before:

    Building Library\Bee\artifacts\WebGL\build\debug_WebGL_wasm\build.js failed with output:
    emcc2: error: C:\Users\HAKIM~1\\AppData\\Local\\Temp\\tmpbk1fz5slGameAssembly.a
    C:\\Users\\HAKIM~1\AppData\Local\Temp\tmpbwlme8_9WebGLSupport_AccessibilityModule_Dynamic.a: No such file or directory ("C:\Users\HAKIM~1\\AppData\\Local\\Temp\\tmpbk1fz5slGameAssembly.a
    C:\\Users\\HAKIM~1\AppData\Local\Temp\tmpbwlme8_9WebGLSupport_AccessibilityModule_Dynamic.a" was expected to be an input file, based on the commandline arguments provided)
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)

    However, I tried uninstalling and re-installing unity hub and tried to build an empty project on version 2020.3.21f1 and it builds perfectly without any errors. My deduction is either the current version that I'm using (2021.3.21f1) that have android and ios build support modules installed and that may cause these errors, or there are some files that I am not aware of that are causing the errors.

    Hope you can help.
     
  4. jackcrosa

    jackcrosa

    Joined:
    Oct 16, 2012
    Posts:
    22
    I have the exact same issue has this been addressed?
     
  5. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    When you get an error like that, look carefully if there might exist any previous errors in the log, and e.g. in C# compilation.

    If the GameAssembly.a file does not exist, that suggests that the C# script compilation did not finish properly. So there is a chance that the root error was something that may have gotten printed before the above errors, but maybe was missed in the logs?

    If you've double checked the logs and there is nothing else, then that is a Unity build system bug. The suggestion to clear the Library/ directory for a reimport might be worth a try (or if you're using git, doing a git clean to build a clean working tree). If that works, that might help you get unstuck.

    If there is nothing else in the logs, definitely do report the test case as a bug.