il2cpp/build/il2cpp.exe did not run properly!

Ok, when I build to WebGL. I keep getting this error: Error building Player: Exception: /Applications/Unity/Unity.app/Contents/Frameworks/il2cpp/build/il2cpp.exe did not run properly!
I have seen many fixes for this error, but none of then work. Does anyone know how to fix this?

For me, restarting my computer (Win 10) and deleting il2cpp_cache and webgl_cache in the Library directory solved the problem.

This video solved the problem: Unity 2017 - Solucion Problema Exportar WebGL - Error - WebGL export solution - failed - YouTube.

Basically, you have to go to this file C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\emscripten.config and change the line in the code that says stack_size=8125 to stack_size=1024.

Restart Unity.

Worked for me!

Fixed it! My problem, was that I had a script that was looking for a public gameobject, but I didn’t give it one. Usually the game will still work, if your compiling something like a windows/mac app. However I was compiling webgl. And webgl can’t handle problems like that. So all I had to do, was give the script, a public text object. I can’t believe it was that simple!

problem fixed here : il2cpp.exe did not run properly - YouTube