Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Error building Player: Exception: Failed building WebGL Player.

Discussion in 'WebGL' started by jonkuze, Jun 11, 2015.

  1. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,685
    OK so here is my share of Console Build Errors after Upgrading to Unity 5.1

    Looks like I'm going back to 5.0.2f1, thanks Unity for the tease of great WebGL features in Unity 5.1 that I can't use due to WebGL Build issues! Arg.... so annoying.... :mad:

    I have no clue what any of this stuff means or how to fix it. Any help would be appreciated.
     
  2. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Can you post a full error output, or your editor.log file?
     
  3. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,876
    Here's mine. I have the same error with 5.1f3.
     

    Attached Files:

  4. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,685
    Sure... here you go!
     

    Attached Files:

  5. abryden

    abryden

    Joined:
    Sep 29, 2014
    Posts:
    24
    My experience (and some others) with this bug is described here:
    http://forum.unity3d.com/threads/failed-building-webgl-player-ongoing.326241/

    I got it working on a fairly clean build only machine but on my main machine it does not work still and even a totally new project I encounter the bug. I did another search and it looks like running as admin may be a solution. Trying this now.

    edit:I ran unity3d as administrator on the machine it doesn't build on. No luck.
     
  6. BlackHunter

    BlackHunter

    Joined:
    Oct 28, 2012
    Posts:
    88
    Webgl have many bugs ! and this is not one !
     
  7. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    The log seems to indicate that emscripten failed to run it's llvm-link executable. We've seen this before on some windows machines during 5.1 beta, which was then usually due to missing Visual Studio C++ redistributable dlls, and would get fixed by installing those. However, we believe that all issues related to that had been fixed, as we now bundle those dlls, so I'm not sure if this is related. I'll ask our QA to do some testing and see if we can get a repro.
     
  8. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Specifically, when you try to execute llvm-link.exe in
    PlaybackEngines/WebGLSupport/BuildTools/Emscripten_FastComp_Win/llvm-link.exe in your unity install on a command line, do you get any errors about missing dlls?
     
  9. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,685
    I'll give it a try as soon as i'm back at my workstation. Thanks for the reply.
     
  10. BlackHunter

    BlackHunter

    Joined:
    Oct 28, 2012
    Posts:
    88
    Please help with my eror . i posted on forum
     
  11. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,876
    Jonas, I'm on Mac. See my log please.
     
  12. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,685
    Nope... It just says something about Not enough positional command line arguments (See screenshot)

    llvm-link.jpg

    Edit: I tried downloading the Visual Studio dlls from here:
    https://www.microsoft.com/en-us/download/details.aspx?id=40784

    But no luck... same build error. :(
     
    Last edited: Jun 12, 2015
  13. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,685
    I tried building with just a single cube in a scene, and still WebGL build failed but it provided a different build error:

    WARNING root: emcc: link command line is very long, even with response file -- use paths with no spaces

    builderror.jpg
     
  14. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,685
    I moved my Unity Project Folder to the Root of C:\ did the test build again with Cube in Scene and now it works! o_O

    I recall seeing a similar issue previously with WebGL Build providing a similar error in 5.0.2f1. My builds would not work until I moved them here "C:\Users\UserName\Unity Projects" that's where I have been building from right now since 5.0.2f1. Now I need to move my project folder to root of C:\ in order to build? Geez... Please take not of this one jonas echterhoff. It's very odd issue... builds fail because Unity does not like the path? :confused:
     
  15. abryden

    abryden

    Joined:
    Sep 29, 2014
    Posts:
    24
    I've seen the "use paths with no spaces" message before but I still have one machine that builds my project and one that doesn't and they both have the project in the same path.
     
    Roman_Keivan and jonkuze like this.
  16. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    yeah, that one is just a warning. The actual error should be what you see when you scroll down, and I'd expect it to be the same. It is definitely a machine setup issue, we just have to figure out what it is.
     
  17. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    But, maybe the message about "command lines being long" provides a clue here as to why it works for some people and not for others:

    Can you check if moving the project to a shorter path name makes a difference? Ie, move your project folder directly to C: ?
     
  18. abryden

    abryden

    Joined:
    Sep 29, 2014
    Posts:
    24
    I tried creating a new project directly in C:. This compiled just fine.

    And the best part . . . My main project in its original location now compiles (on both machines now). This is a really strange bug. Good luck tracking it down.
     
    jonkuze likes this.
  19. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,685
    I was thinking to try now moving the project from C:\ back to it's orginal location and see if it builds now lol. Such an odd bug! I'm happy to at least be able to build and make use of the new Unity 5.1 WebGL features. Although would be nice keep my projects where I want them and not at the root of C:\. :rolleyes:
     
  20. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    So, just to confirm: Moving to C:\ did fix building for you?
     
    jonkuze likes this.
  21. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,685
    Yep it did! I just Updated my game now with Unity 5.1 WebGL Features! (shaved off 13MB from the Build Size) Whoohoo! :D
     
    abryden likes this.
  22. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,685
    Although keep in mind, I did not figure out or even think to move the project into the C:\ until I did the smaller WebGL test build with a single cube. It's odd that my game project did not display the "link command line is very long" error.
     
  23. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,876
    I'm glad for you guys. Now, I'm on Mac and can't build for WebGL...!
     
    maximus2323 likes this.
  24. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,685
    By the way, Now I just tried to Move my Project back to it's original location after a successful build from root of C:\, now the build works! What the heck... i'm happy it's working, but really such an annoying issue that slowed my progress for a bit.
     
    maximus2323 likes this.
  25. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,685
    Did you try moving your Project to root of C:\ or try building with a blank scene and a cube the way i did above? what errors do you get if you try that?
     
    maximus2323 likes this.
  26. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,876
    Well, on Mac there's no C:\.... I still have to try on Windows anyway. Here's my log:
     

    Attached Files:

  27. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,685
    Well you have a hard drive lol, so whatever the root directory of your hard drive is, place a copy of your project there and try to build from there.
     
    maximus2323 likes this.
  28. merlin981

    merlin981

    Joined:
    Apr 16, 2012
    Posts:
    305
    I have the same issue, and opened a ticket (http://fogbugz.unity3d.com/default.asp?697790_1brs4i2o8oph2j8b), which still hasn't been answered by Unity.

    However, I did find (today), that moving the entire project to a shorting folder name worked for me. I moved it to C:\MyProject.

    I tested, and it doesn't have to be on the C drive, but the folder name needs to be short.

    I'm guessing that the emscript is trying to access something in the assets folder, with a directory + filename longer than 250 characters.

    Maybe Unity can use the short directory names for this process ?
     
    maximus2323 likes this.
  29. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Thanks for the bug report!

    We think we narrowed down the problem and we are implementing a fix. Stay tuned..
     
    maximus2323 and jonkuze like this.
  30. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,685
    Cool good know!
     
    maximus2323 likes this.
  31. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,428
    I've got this problem also. The only fix / that worked was running Unity 3D as Administrator.
     
    maximus2323 likes this.
  32. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    you probably encountered a similar bug, specific to Windows and 5.1.2p3 / 5.1.3 which is fixed in the latest 5.1.3 patch
     
  33. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    I am on 5.3.2 and have the same error when building WebGL package.
     
  34. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    could you try the latest patch ?
     
  35. ArtemYaremchuk

    ArtemYaremchuk

    Joined:
    May 31, 2018
    Posts:
    1
    Man thanks for your question. i fixed my problem with webgl
    p.s. sorry for possible errors
     
  36. Boban1234

    Boban1234

    Joined:
    Jul 17, 2020
    Posts:
    1
    Think I've got same error today. While building game for WebGL 3 errors have occurred.
    First starts with:
    After reading this topic, I tried to:
    -running unity as administrator (it didn't help)
    -move my project folder to C: \ (it helped, original path was probably too long)
    But some people said that after moving project to C:\ they can also build at original path, that doesn't worked for me. I can only build at C:\, when moved project back to its original path the errors occured again.

    So probably this error is still alive.
    Unity version: Unity 2019.4.5f1 (64-bit)
    I also upload my Editor.log file.

    EDIT: Ok, it was my mystake. I just discovered that one of the folders had a 'ż' letter from my language (polish) in it's name. After renaming the folder, the project builds normally.
     

    Attached Files:

    Last edited: Jul 28, 2020
    Roman_Keivan and shev8987 like this.
  37. Roman_Keivan

    Roman_Keivan

    Joined:
    May 31, 2019
    Posts:
    21
    This error is still alive 2020.3
    .
     
    unity_wlxGlg02W6Vwng likes this.
  38. AkhiJamali

    AkhiJamali

    Joined:
    Oct 7, 2021
    Posts:
    1
    i am facing this issue as well
     
  39. TanijaTheFaun

    TanijaTheFaun

    Joined:
    Aug 16, 2021
    Posts:
    2
    Same, using Unity 2021 and this occurs!
     
  40. endererolreotek

    endererolreotek

    Joined:
    Mar 28, 2022
    Posts:
    4
    Exception: Failed building WebGL Player.
    UnityEditor.WebGL.ProgramUtils.StartProgramChecked (System.Diagnostics.ProcessStartInfo p) (at /Users/bokken/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/ProgramUtils.cs:48)
    UnityEditor.WebGL.WebGlBuildPostprocessor.EmscriptenLink (UnityEditor.Modules.BuildPostProcessArgs args, System.Boolean wasmBuild, System.String sourceFiles, System.String sourceFilesHash) (at /Users/bokken/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:445)
    UnityEditor.WebGL.WebGlBuildPostprocessor.LinkBuild (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/bokken/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:495)
    UnityEditor.WebGL.WebGlBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/bokken/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:933)
    UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <2f1c602eae0d45c293fff3e3aef759fa>:0)
    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 <2f1c602eae0d45c293fff3e3aef759fa>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    still have this problem 2019.4.17f1
     
  41. aumsohoni

    aumsohoni

    Joined:
    Oct 22, 2021
    Posts:
    4
    I still got this issue , in 2020.3.25F1 I tried moving the build and root folder in C:/ but no works
     

    Attached Files:

  42. LuckyGuai

    LuckyGuai

    Joined:
    Dec 4, 2019
    Posts:
    2
    2020.3.33f1 exists the same error .oh my god!!!
     
  43. LuckyGuai

    LuckyGuai

    Joined:
    Dec 4, 2019
    Posts:
    2
    hello ,Have you found a solution of this problem?