- Home /
Unable to build with WebGL Template
I've created a custom template for WebGL which I can choose when I build the project (as I've done with WebPlayer templates in the past) but when building with anything other than the default template I receive the following error:
Failed running python "/Applications/Unity 5.1.1f1/Unity.app/Contents/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emcc" @"/Users/whoever/whatever/Assets/../Temp/emcc_arguments.resp"
stdout: stderr: [0;33mwarning:[0m emitted code will contain very large numbers of local variables, which is bad for performance (build to JS with -O2 or above to avoid this - make sure to do so both on source files, and during 'linking') warning: unresolved symbol: glFlushMappedBufferRange warning: unresolved symbol: glGetInternalformativ warning: unresolved symbol: tcflush warning: unresolved symbol: pthread_create warning: unresolved symbol: _ZN4FMOD13DSPConnection6setMixEf warning: unresolved symbol: glUnmapBuffer warning: unresolved symbol: glGetStringi warning: unresolved symbol: glProgramBinary warning: unresolved symbol: glMapBufferRange warning: unresolved symbol: glGetProgramBinary warning: unresolved symbol: glCopyBufferSubData Traceback (most recent call last): File "/Applications/Unity 5.1.1f1/Unity.app/Contents/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emcc", line 1656, in assert '{{{ SCRIPT }}}' in shell, 'HTML shell must contain {{{ SCRIPT }}} , see src/shell.html for an example' AssertionError: HTML shell must contain {{{ SCRIPT }}} , see src/shell.html for an example
Using Unity 5.1.1f1 on a Mac.
Any tips?
Answer by Schubkraft · Jul 08, 2015 at 12:37 PM
Hello,
it works well for me. Can you submit a bug report with the project attached that is showing the issue for you?
Answer by prestonmatterport · Aug 01, 2015 at 03:30 AM
I was getting the same error.
In WebGLTemplates, I had a simple 'index.html' with an iframe. The iframe referred to 'unityContent.html', which was also in WebGLTemplates. 'unityContent.html' contained the <canvas>
and %UNITY_WEBGL_LOADER_GLUE%
elements.
Unity couldn't handle this. It failed to compile, with that error.
So in my WebGLTemplates, I renamed 'index.html' to 'index_wrapper.html', and renamed 'unityContent.html' to 'index.html'. This built just fine. Then, in the build, I renamed 'index.html' back to 'unityContent.html', and renamed 'index_wrapper.html' back to 'index.html'. This ran the webgl player just fine.
Answer by Schubkraft · Aug 03, 2015 at 03:30 PM
Thanks @prestonmatterport for submitting a repro project. We are tracking it as a bug now.
Your answer
Follow this Question
Related Questions
When Unity3D finally supports WebGL? 2 Answers
Unity 4 compatibility to Unity 5 WebGL 1 Answer
GL build won't run on Chrome 1 Answer
Issue with shaders and WebGL 1 Answer
WebGL + JSLIB Plugin, using functions 3 Answers