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. Dismiss Notice

IL2CPP/WebGL on Linux

Discussion in 'WebGL' started by izba, Feb 7, 2020.

  1. izba

    izba

    Joined:
    Nov 6, 2017
    Posts:
    1
    Not sure if this is the correct place to post this, but i decided that there could be others strugling with this problem so i should share this.

    So when you install Unity on Linux and have problems with exporting to WebGL or have problem with exporting with IL2CPP (WebGL uses automaticly IL2CPP for building). You should check that il2cpp has right permissions.

    chmod +x /home/$Username/Unity/Hub/Editor/$EditorVersion/Editor/Data/il2cpp/build/deploy/netcoreapp3.0/il2cpp


    Remember to change $Username to your username and $EditorVersion to your editor version. I'm Using 2020.1.0a21 version.

    Also you should check that python2 is installed and if you use Arch Linux like i do check that you have installed ncurses5-compat-libs from AUR. IL2CPP need libtinfo-5.so library for the building process and ncurses5 provides it.

    Best Regards,
    Izba
     
    usewits likes this.
  2. usewits

    usewits

    Joined:
    Aug 4, 2020
    Posts:
    7
    I also got the build to work, but only after following your advice + some additional debugging. Thanks so much for writing your findings down!! The issues you describe are still relevant 7 months later.

    My unity installation was at /usr/local/unity. I had to also remove a local emscripten install from my path (afaik newer versions of emscripten don't provide il2cpp anymore). On fedora, I installed ncurses-compat-libs.x86_64 to provide libtinfo-5.so. Finally, both brotli and gzip compression don't work for me (even when fixing that its somehow trying to use the macOS verion of brotli). It looks like its due to the python2 version of gzip and brotli packages are not present by default, and also no longer available (at least on Fedora). When disabling asset compression altogether, the project is exported successfully for me.

    If only we could check the code/send Unity a pull request in these situations :')
     
  3. Alkis05

    Alkis05

    Joined:
    Jun 5, 2018
    Posts:
    2
    Thank you very, very much. I was looking a solution for this all they. I'm a fellow arch user and izba tip worked here too. I'm using 2019.4LTS

    I remembered reading something about ncurse5 lib in the arch wiki, but it was for another issue:
    "In unity 2019 and newer, if you see a message along the lines of: DllNotFoundException: Unable to load the unmanaged library (x) Reason: libtinfo.so: cannot open shared object file: No such file or directory , try installing ncurses5-compat-libsAUR."
    I added it to the wiki to help dissiminate this info.

    In regards to usewits remarks, I also had the same problems with brotli, but choosing gzip did work for me.
     
    Last edited: Nov 19, 2020
  4. kurosuzume_

    kurosuzume_

    Joined:
    Nov 25, 2020
    Posts:
    1
    Thank you very much. I'm running Unity2020.1.10f1 on ubuntu 20.04 and had the same problem.
    I repeated @izba steps, and solved the IL2CPP issue, but other issues appeared as shown bellow.
    Then, I tried changing the Compression format settings, and with both Brotli and Gzip the building didn't work.
    Later I tried with Compression Format Disabled and it did.
    I'm unsure if this could be helpful to anyone else, but since it worked for me, I thought it would be nice to share.

    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.CompressAndMarkBrotli (System.String path) (at /Users/bokken/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:835)
    UnityEditor.WebGL.WebGlBuildPostprocessor.CompressBuild (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/bokken/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:848)
    UnityEditor.WebGL.WebGlBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/bokken/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:920)
    UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at /home/bokken/buildslave/unity/build/Editor/Mono/Modules/DefaultBuildPostprocessor.cs:27)
    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 /home/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:324)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&) (at /home/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)
     
  5. attishno1

    attishno1

    Joined:
    Dec 6, 2016
    Posts:
    18
    Thanks man. Although you can do an uncompressed build and it works without a problem.