Search Issue Tracker

Won't Fix



Found in


Issue ID




Linux Editor WebGL build always fails with "System.ComponentModel.Win32Exception (2): No such file or directory" error



How to reproduce:
1. Create a new project
2. Press Ctrl+Shift+B to open the Build Settings window
3. Switch to WebGL
4. Build the project

Expected result: the build succeeds
Actual result: the build fails with "System.ComponentModel.Win32Exception (2): No such file or directory" exception

Reproducible with: 2019.4.29f1, 2020.3.15f2, 2021.1.16f1
Not reproducible with: 2021.2.0b5, 2022.1.0a5

1. Reproducible on Ubuntu 18.04
2. Not reproducible on Windows 10

  1. Resolution Note:

    This works in 2021.2 beta builds. Linux is not officially supported on older builds.

Comments (10)

  1. Wade_Hall

    Jul 08, 2022 20:01

    Figured out a WebGL fix for Ubuntu 20.04.4 LTS running Unity 2020.3.36f1 LTS and 2021.3.5f1 LTS. Had 2 WebGL build errors too long to post here. Fix details are below.

    First one was fixed by installing:
    sudo apt install python2

    Second one fixed by installing:
    sudo apt-get install libncurses5:amd64
    (note that I had tried to run the following command before this, but nothing that I could see actually happened:
    sudo ln -s /usr/lib/ /usr/lib/

    This allowed a WebGL to be built with Gzip compression format and published to Unity Play successfully.

    To get the build to run locally I had to first build with compression disabled:
    File>Build Settings>Player Settings>Publishing Settings>Compression Format>Disabled

    Then, with the folder containing index.html (where you built your WebGL), right-click empty space in folder>Open in Terminal.

    With python3 and python2 installed, you can start a local server with:
    python3 -m http.server
    python2 -m SimpleHTTPServer

    "CTRL" + "C" to shut down server within terminal.

    In your browser you can now enter localhost:8000 into the URL bar to run your game.

    You can also run your game in a different port if 8000 is used or you want to run multiple games. For example:
    python3 -m http.server 7500
    python2 -m SimpleHTTPServer 7000

    I sincerely hope this keeps others from wasting as much time as I did looking for solutions. It was a real pain. Console build errors were too long to reasonably search for. Winning search results were to chop up the errors and even then I mostly got info for MacOS.

  2. gabrielcolmena

    Apr 04, 2022 22:21

    Any workaround so far?

  3. peng_can

    Mar 28, 2022 12:37

    I also encountered this problem after I upgrade the Mac to 12.3, with Unity@2020.3.32f1c1. Does anyone knows how to fix it

  4. M_R_Antonio

    Mar 23, 2022 10:01

    Also happening to me on MacOS M1 on a fresh created project:

    System.ComponentModel.Win32Exception (2): No such file or directory
    at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
    at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
    at System.Diagnostics.Process.Start()
    at Unity.IL2CPP.Shell.SetupAndStart(ExecuteContext context, Boolean asyncMode) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Shell/Shell.cs:line 423
    at Unity.IL2CPP.Shell.ExecuteAsync(ExecuteArgs executeArgs, IExecuteController controller, Boolean asyncMode) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Shell/Shell.cs:line 299
    at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Shell/Shell.cs:line 355
    at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Building/CppProgramBuilder.cs:line 334
    at Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_0`2.<RunWithResult>b__0(Object o) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Building/ParallelFor.cs:line 78

  5. nanohazard

    Mar 22, 2022 01:09

    yes, same with me after the update in monterey 12.3 this is also happening when building unity webgl. works fine on last os version of monterey.

  6. MikeSz

    Mar 18, 2022 10:59

    Builds worked fine for months until updated Mac to Monterey 12.3 and Command Line Tools. Since then we see this error even on completely fresh project

    2020.3.26, 2020.3.31 (latest)

  7. zibas

    Feb 25, 2022 23:57

    I'm confused about this being marked "Won't Fix" for an active LTS branch like 2020. The unity hub on linux probably shouldn't advertise the LTS status of the editor if it's not actually supported.

    Shouldn't this at least be included in the known issues list for every future release on the 2020 LTS branch then?

  8. shuntar

    Feb 22, 2022 01:31

    My unity version is 2020.3.26f1.

  9. shuntar

    Feb 22, 2022 01:29

    It also happens on Macos.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.