Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

WebGL build failed - Unity looking for wrong version of Emscripten?

Discussion in 'WebGL' started by AnthonyPalma, Feb 12, 2020.

  1. AnthonyPalma

    AnthonyPalma

    Joined:
    Aug 11, 2013
    Posts:
    128
    Hello! I'm having an issue building to WebGL (both my existing project and a new blank project). Part of the output of the error says it can't find a version of Emscription (1.29.0) on my computer, which is true - my PC has 1.35.9 installed. The problem is, I can't install 1.29.0 via command line because the Emscripten repo seems to no longer exist (you can try for yourself by following the steps here).

    Any ideas on what I can do to fix this? I am on Windows 10 and have tried this with Unity 2019.2.13 and 2019.3.0 with the same result. Thanks in advance!

    Here's that part of the build output that I mentioned:

    stdout:
    Building build.bc with EmscriptenToolChain
    Output directory: C:\Users\CoreLabs\Unity Projects\2D Multiplayer Shooter\Temp\StagingArea\Data\Native
    Cache directory: C:\Users\CoreLabs\Unity Projects\2D Multiplayer Shooter\Library\il2cpp_cache
    il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files\Unity\Hub\Editor\2019.3.0f6\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_Win\python\2.7.5.3_64bit\python.exe: can't open file 'C:\Program Files\Emscripten\emscripten\1.29.0\emcc': [Errno 2] No such file or directory
     
    DrViJ likes this.
  2. AnthonyPalma

    AnthonyPalma

    Joined:
    Aug 11, 2013
    Posts:
    128
    Quick update: I completely uninstalled and reinstalled Unity onto a completely different drive inside my PC, but I'm still getting the same error. Also now my VC Code code completion is broken haha. What a day!
     
  3. WilliamLeu

    WilliamLeu

    Joined:
    Jul 27, 2012
    Posts:
    17
    I was completely missing an Emscriptem folder in "Program Files". I fixed a similar issue by making the missing folders by hand in Program Files and copying the contents of "C:\Program Files\Unity\Hub\Editor\2019.4.7f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten" into that folder.

    Although, I'm somewhat mystified how I got to a state where Unity has the files it needs packaged within itself, but tries to reference it from a folder that doesn't exist.
     
unityunity