I get an error when I try to export my game to WebGl

Failed running “C:\Program Files\Unity\Editor\Data\PlaybackEngines\webglsupport/BuildTools/Emscripten_Win/python/2.7.5.3_64bit/python.exe” “C:\Program Files\Unity\Editor\Data\PlaybackEngines\webglsupport/BuildTools/Emscripten/emcc” @“C:/Users/me/Desktop/development/unity_projects/unity5/shapeClicker/Shape Clicker/Assets/…/Temp/emcc_arguments.resp”

stdout:
WARNING: sanity check failed to run [Errno 13] Permission denied: ‘C:\Program Files\Unity\Editor\Data\PlaybackEngines\webglsupport/BuildTools/emscripten.config_sanity’
WARNING: sanity check failed to run [Errno 13] Permission denied: 'C:\Program …

Exception: Failed building WebGL Player. UnityEditor.WebGL.ProgramUtils.StartProgramChecked (UnityEditor.Utils.Program p) UnityEditor.WebGL.WebGlBuildPostprocessor.PostProcess (BuildPostProcessArgs args) UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:316)

It happens after native compile to JS.

I’ve tried with the memory limit at 256 and 512.

I am using Unity 5.1.1f1.

I am using a 64 bit windows machine.

I have tried it in slow and fastest mode.

I found these.

http://forum.unity3d.com/threads/failed-building-webgl-player.321433/

The second one seems like there is a bug in Unity. I tried to comment but apparently I don’t have the privileges.
I installed cmake but it didn’t work. I also use Visual Studio to write my code.

Anybody have any experience with this bug and know more about it?
Thanks.

  1. Close the Unity.
  2. Remove the Library folder of you project to re-import and generate all those files again.
  3. Edit the file C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\emscripten.config
  4. Change the value --stack_size to 2048
    111647-fixing-webgl-build-errors.png
  5. Open your project and Build.

Hi, I don’t know too much about it, but from what I have found it seems like it is possible to revert back to a 5.0.2 and export at Fast (but not fastest). Haven’t personally tried this yet, but from what I’ve read this sounds like a viable option until the next release.

EDIT: I was able to export just now in 5.1.0f3 64bit. Had to install CMake and run as administrator. Haven’t tried building at Fast or Fastest optimizations yet, but will comment when I have results.

The solution is here!

Thank from Colombia, I run unity as Adminitrator and solved the problem all worked out great Edy

if anyone still looking.
on unity-2019 removing unused .jslib file from “Plugins” folder worked for me.

It is possible that this bug is a file access or creating and saving new . How about using XML and filming data in a temp folder . There is no support in browsers for the operation. Maybe unity does not represent a problem but when compiling arises insurmountable error .

Do you use maybe the FUNCTION :

System.IO.File.WriteAllBytes ?
or
Directory.CreateDirectory ( Application.persistentDataPath …