Search Unity

  1. 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 with development build fails

Discussion in 'WebGL' started by fwalkerCirca, Aug 28, 2018.

  1. fwalkerCirca

    fwalkerCirca

    Joined:
    Apr 10, 2017
    Posts:
    57
    Ok so we are desperate. We have tried everything we can think of. We upgraded from 2017.1.1.f1 to 2018.2.5f1. And now we are unable to build the development version and we need it.

    Yes we have enough disk space (this is happening in 3 computers). I have tried re-installing moving location of project and Unity.

    A simple Cube project builds with out a problem. I have tried duplication the settings of that project.

    I can't think of anything else to try, and going back to 2017 would be a huge effort after all the changes we made to make 2018 work. Here is the error we are getting:

    Failed running "C:\Unity2018\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_Win\python\2.7.5.3_64bit\python.exe" "C:\Unity2018\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emcc" @"[our project path]\Assets\..\Temp\emcc_arguments.resp"
    stdout:
    stderr:WARNING:root:--separate-asm works best when compiling to HTML. Otherwise, you must yourself load the '.asm.js' file that is emitted separately, and must do so before loading the main '.js' file. [-Wseparate-asm]
    warning: unexpected number of arguments 2 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0
    warning: unexpected number of arguments 4 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0
    warning: unexpected number of arguments 2 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0
    warning: unexpected number of arguments 4 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0
    warning: unexpected number of arguments 5 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0
    warning: unexpected number of arguments 4 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0
    warning: unexpected number of arguments 2 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0
    warning: unexpected number of arguments 3 in call to '_ZN6il2cpp6icalls8mscorlib6System6String22RedirectToCreateStringEv', should be 0
    error: unresolved symbol: Aborting compilation due to previous errors | undefinedTraceback (most recent call last):
    File "C:\Unity2018\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emcc", line 10, in <module>
    python_selector.run(__file__, profile=True)
    File "C:\Unity2018\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\python_selector.py", line 43, in run
    sys.exit(run_by_import(filename, main) if on_allowed_version() else run_by_subprocess(filename))
    File "C:\Unity2018\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\python_selector.py", line 13, in run_by_import
    return getattr(importlib.import_module(os.path.basename(filename)), main)()
    File "C:\Unity2018\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emcc.py", line 1611, in run
    final = shared.Building.emscripten(final, append_ext=False, extra_args=extra_args)
    File "C:\Unity2018\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\shared.py", line 2009, in emscripten
    call_emscripten(cmdline)
    File "C:\Unity2018\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten.py", line 2340, in _main
    temp_files.run_and_clean(lambda: main(
    File "C:\Unity2018\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\tempfiles.py", line 93, in run_and_clean
    return func()
    File "C:\Unity2018\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten.py", line 2345, in <lambda>
    DEBUG=DEBUG,
    File "C:\Unity2018\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten.py", line 2251, in main
    temp_files=temp_files, DEBUG=DEBUG)
    File "C:\Unity2018\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten.py", line 99, in emscript
    glue, forwarded_data = compiler_glue(metadata, settings, libraries, compiler_engine, temp_files, DEBUG)
    File "C:\Unity2018\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten.py", line 226, in compiler_glue
    glue, forwarded_data = compile_settings(compiler_engine, settings, libraries, temp_files)
    File "C:\Unity2018\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten.py", line 532, in compile_settings
    cwd=path_from_root('src'), error_limit=300)
    File "C:\Unity2018\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\jsrun.py", line 132, in run_js
    raise Exception('Expected the command ' + str(command) + ' to finish with return code ' + str(assert_returncode) + ', but it returned with code ' + str(proc.returncode) + ' instead! Output: ' + str(ret)[:error_limit])
    Exception: Expected the command ['C:/Unity2018/Editor/Data\\Tools\\nodejs\\node.exe', '--stack_size=8192', '--max-old-space-size=4096', 'C:\\Unity2018\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\Emscripten\\src\\compiler.js', 'C:\\Users\\FWalker\\AppData\\Local\\Temp\\tmpzn8ls3.txt', 'C:\\Unity2018\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\Audio.js', 'C:\\Unity2018\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\Cursor.js', 'C:\\Unity2018\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\Eval.js', 'C:\\Unity2018\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\FileSystem.js', 'C:\\Unity2018\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\Logging.js', 'C:\\Unity2018\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\Profiler.js', 'C:\\Unity2018\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\SystemInfo.js', 'C:\\Unity2018\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\UnetWebSocket.js', 'C:\\Unity2018\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\Video.js', 'C:\\Unity2018\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\WebCam.js', 'C:\\Unity2018\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\WebGL.js', 'C:\\Unity2018\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\WebRequest.js', 'D:\\Development\\game-client-ng\\Assets\\Plugins\\WebGL\\OpenWindow.jslib', '[our project path]\\Assets\\Plugins\\WebSocket.jslib', '[our project path]\\Assets\\Plugins\\WebGL\\DownloadFile.jslib', '[our project path]\\Assets\\Plugins\\WebGLMovieTexture.jslib', '[our project path]\\Assets\\Plugins\\WebGL\\OpenBrowserWindow.jslib', 'C:\\Unity2018\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\Emscripten\\src\\library_pthread_stub.js'] to finish with return code 0, but it returned with code 1 instead! Output: // The Module object: Our interface to the outside world. We import
    // and export values on it. There are various ways Module can be used:
    // 1. Not defined. We create it here
    // 2. A function parameter, function(Module) { ..generated code.. }
    // 3. pre-run appended it, var Module = {}; ..generated
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    (Our project path has been obfuscated for security)
    What am I missing? ...
     
  2. PieterAlbers

    PieterAlbers

    Joined:
    Dec 2, 2014
    Posts:
    143
    We are getting this too.

    I am trying to build a development build with autoconnect profiler toggled on.
    Have tried building to wasm, asm and both, but the error keeps showing up.
    We have Explicitly thrown exceptions only turned on.
     
  3. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    the error seems to be an "unresolved symbol" but for some reason it does not print which symbol. It's probably something that you are referencing from scripts which is not implemented in your plugins.
     
  4. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    please post your editor.log
     
  5. PieterAlbers

    PieterAlbers

    Joined:
    Dec 2, 2014
    Posts:
    143
    No need - I got it sorted. I wasn't paying attention to the details in the log.
    I was indeed referencing something that wasn't implemented in one of our jslibs.

    I am sorry for wasting your time - and I should stop blindly copy pasting stuff from other projects :S
     
  6. douglassophies

    douglassophies

    Joined:
    Jun 17, 2012
    Posts:
    106
    I have this same issue. Have had it in the past and was fixed by correcting mistakes in a plugin file. Removed all my plugins and still have the issue though. My log file has no reference to the plugin folder like in OP's log. I switched from webGL buil to standalone to WebGl and it seemed to break it. Returning to previous build on Github is not fixing the issue. Many other posts online about disk space or changing build and project location do not seem to help either.
     
  7. fwalkerCirca

    fwalkerCirca

    Joined:
    Apr 10, 2017
    Posts:
    57
    We never came up with a fix and we are extremely frustrated. We even upgraded to the latest 2018.3.5f1 hoping for a miracle fix and nothing :(
     
  8. douglassophies

    douglassophies

    Joined:
    Jun 17, 2012
    Posts:
    106
    This was a frustrating one. As i said, i have had this issue many times before but with different solutions. Today's was to delete the library folder. (I also went back to a previous commit but have since reinstated those changes and they work).
    Just to round up my findings from other posts:
    • Delete library folder as i said(personal experience)
    • Something in the plugins folder is broken (personal experience)
    • Mysteriously goes away after hours of tinkering and hair pulling (personal experience)
    • Change build platform
    • Changing directory
    • Ensuring the project and the new build locations both have enough space for the build
     
    Last edited: Feb 19, 2019
  9. krisss666

    krisss666

    Joined:
    Feb 14, 2014
    Posts:
    18
    Hello Douglassophies
    In my case (https://forum.unity.com/threads/webgl-failed-to-build-my-project.632122/)
    i made the following step
    • Change build platform
    • i delete library folder
    • create a new project and copy/past all asset folder only (not input or tag)
    • Ensuring the project and the new build locations both have enough space for the build

      i'm thinking something is broken in the scripts (or make webgl broke) but this don't happen in 2017 unity..
      You seams to have some experience in this issue, could you check my post pls :)
      Maybe i should go back to unity 2017 version !
     
  10. chyrho

    chyrho

    Joined:
    Nov 1, 2016
    Posts:
    3
    If anyone is still looking for solution for this issue, check all your jslib files and see if there is a string typed property at the top level of the library. For example:

    Code (JavaScript):
    1. mergeInto(LibraryManager.library, {
    2.     someString: "SomeValue",
    3. //  ...
    4. });
    Such property is processed by emscripten as a function alias / name redirection. Emscripten looks for a library function named "SomeValue" and would fail the build if such function does not exist. In my case, the string value was empty, the error emscripten gave was like "unresolved symbol:". There was no symbol listed after because the symbol name was an empty string.
    If you want to know the detail, clone emscripten repo and look into jsifier.js.
     
    Lapsapnow likes this.
unityunity