Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

IL2CPP compile fails on empty project

Discussion in 'Web' started by wastvedt, Sep 3, 2015.

  1. wastvedt

    wastvedt

    Joined:
    Oct 6, 2012
    Posts:
    25
    I'm getting an error when trying to build any project in WebGL. I'm on 5.1.3p1 but the error also appears on 5.1.2f1. Building has worked for me before on 5.1.2, so it makes me think I inadvertently changed something on my system. I've also tried building an empty 3d project on 5.1.3p1, which gives me the same error. I've attached the log from this last attempt.

    I'm no expert at reading logs, but I did notice that the first error that shows up appears to be something to do with loading the python extension module _multiprocessing:

    File "C:\Python27\lib\multiprocessing\__init__.py", line 84, in <module>

    import _multiprocessing

    ImportError: DLL load failed: %1 is not a valid Win32 application.​

    However, I have the _multiprocessing file at C:\Python27\DLLs\_multiprocessing.pyd and can import it just fine (I think) in IDLE.
     

    Attached Files:

  2. wastvedt

    wastvedt

    Joined:
    Oct 6, 2012
    Posts:
    25
    Just tried a couple more things, without success. I removed the system version of Python, and updated to 5.1.3p2, but I still get compile errors. I'm now seeing a different ImportError (though this is on my actual project, not the empty one, so that could be the reason for the difference):

    ImportError: No module named site​
     
  3. wastvedt

    wastvedt

    Joined:
    Oct 6, 2012
    Posts:
    25
    One more update. I copied the entire project folder onto another computer with the same hardware specs, installed the same version of Unity, and was able to build the project. I've also tried uninstalling Unity, removing all preferences, and reinstalling, so it seems it's my computer. I have no idea what to look for though.
     
  4. wastvedt

    wastvedt

    Joined:
    Oct 6, 2012
    Posts:
    25
    For the record, in case anyone else runs into this, here's what happened. After installing Python 2.7 I was no longer able to build to WebGL, as above. Uninstalling didn't help, because I found that Python left behind a system variable, PYTHONHOME. When I deleted that, WebGL builds started working again. I then installed Python 3.4, which did not create the PYTHONHOME variable. I'm not sure if that's because of the new version, or if some other program I installed created that system variable.
     
    Livich, meir192 and AdenFlorian like this.
  5. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    It seems this issue was never investigated properly until now. We have a fix that will land soon on 2019.1 and maybe 2018 LTS.
     
  6. bathurst42

    bathurst42

    Joined:
    May 23, 2018
    Posts:
    1
    I can't seem to find the PYTHONHOME variable. I've tried everything else to do a WebGL build but nothing seems to be working.
     
  7. mkeelecircadence

    mkeelecircadence

    Joined:
    Oct 3, 2017
    Posts:
    6
    I don't seem to have PYTHONHOME variable either... don't even have python installed on this box. Same frustration with inability to make a development webgl build
     
  8. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    could you please attach the editor log here?
     
  9. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    could you please attach the editor log here?
     
  10. delphinius81

    delphinius81

    Joined:
    Mar 6, 2012
    Posts:
    57
    Hi @Marco-Trivellato I am also experiencing the error where il2cpp.exe stops working on 2018.3.8f1. I have a Unity scene with several meshes/materials, but no custom code or plugins - only unity provided components. Please see the attached editor log for details.

    I also tried building in 2018.3.11f1, as there were some il2cpp related fixes between the patch versions. However the issue persisted. See the log file with 2018.3.11 in its name.

    I do have a python installation on my computer, but not a PYTHONHOME environment variable. I have a PYTHONPATH env var which references a python 2.7 installation that is part of some other company software.

    I'll try a 2019 beta version, but my company is not quite ready to make the jump from 2018 to 2019 just yet.
     

    Attached Files:

  11. delphinius81

    delphinius81

    Joined:
    Mar 6, 2012
    Posts:
    57
    Error persists in 2019.1.0b8 as well - has the fix made it into 19.1 yet?
     
  12. OUTERDARKNESS

    OUTERDARKNESS

    Joined:
    Feb 27, 2013
    Posts:
    35
    Same Issue here, building WebGL, using Unity_2018.2.5 on Windows 10.


    Failed running X:\ProgramFiles\Unity_2018.2.5\Editor\Data\il2cpp/build/il2cpp.exe --convert-to-cpp --compile-cpp --libil2cpp-static --platform="WebGL" --architecture="EmscriptenJavaScript" --configuration="Release"

    il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: ImportError: No module named site

    Unhandled Exception: Unity.IL2CPP.Building.BuilderFailedException: ImportError: No module named site



    Setting env variables for PYTHONHOME / PYTHONPATH didn't help. Uninstall / reinstall of Python & Unity Editor didn't help.
     
  13. delphinius81

    delphinius81

    Joined:
    Mar 6, 2012
    Posts:
    57
    FYI, removing the PYTHONHOME / PYTHONPATH environment variables resolves the issue for me, but anything else that is expecting those env. vars. to exist will of course fail to run. Is there a status on this issue?
     
  14. Carravan

    Carravan

    Joined:
    Oct 13, 2019
    Posts:
    1
    I don't even have python 2.7 and I have an issue building and running web gl. (I do have 3.6 and 3.7 python fyi)
    My error log is:
    UnityEditor.BuildPlayerWindow+BuildMethodException: 6 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00242] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:190
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:95
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    # NOTE: That emoji is ": P" without the space ( lol wtf )
    Any ideas?

    (the error was after opening build setttings->select webgl->build and run)
     
  15. AlgetecTec

    AlgetecTec

    Joined:
    Apr 15, 2019
    Posts:
    5
    Same Issue here, building WebGL, using Unity_2019.3.0 on Windows 10.

     
  16. AlgetecTec

    AlgetecTec

    Joined:
    Apr 15, 2019
    Posts:
    5
    I've tried everything...
     
  17. mefra10

    mefra10

    Joined:
    May 17, 2020
    Posts:
    1
    I had the same issue (Unity 2019.3.0, Windows 10) and could solve it doing the following:
    • remove python (uninstall or rename installation folder)
    • remove PYTHONHOME variable!
    • reboot (without reboot unity was not picking up the changes)
     
    rh_galaxy likes this.
  18. rh_galaxy

    rh_galaxy

    Joined:
    Jan 13, 2019
    Posts:
    8
    Using 2020.1.13f1 here, and the same worked for me...