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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

[2019.1.8f1] "failed to load il2cpp unity" on Windows 7 machines

Discussion in 'Windows' started by arturaz, Jun 26, 2019.

  1. arturaz

    arturaz

    Joined:
    Mar 28, 2013
    Posts:
    30
    Last edited: Jun 26, 2019
  2. vladk

    vladk

    Joined:
    Jul 10, 2008
    Posts:
    167
    Same here, happens on the latest version 2019.1.8f1
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,527
    Hey, we will take a look at this ASAP. Can you fill a bug report (just describing the situation and an empty Unity project attached)?
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,527
    I found the root cause. I will post a workaround in a little bit. We'll also include the fix in a patch release as soon as possible.
     
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,527
    Here's a workaround. Open "<UNITY_INSTALL_DIR>\Editor\Data\il2cpp\libil2cpp\os\Win32\File.cpp" and apply this diff:

    Code (csharp):
    1. diff --git a/libil2cpp/os/Win32/File.cpp b/libil2cpp/os/Win32/File.cpp
    2. index 3d7f48279..1b928f663 100644
    3. --- a/libil2cpp/os/Win32/File.cpp
    4. +++ b/libil2cpp/os/Win32/File.cpp
    5. @@ -503,7 +503,11 @@ namespace os
    6.                  {
    7.                      success = TRUE;
    8.                      // The async write succeeded. Now get the number of bytes written.
    9. +#if IL2CPP_TARGET_WINDOWS_DESKTOP
    10. +                    if (GetOverlappedResult((HANDLE)handle, &overlapped, (LPDWORD)&written, TRUE) == 0)
    11. +#else
    12.                      if (GetOverlappedResultEx((HANDLE)handle, &overlapped, (LPDWORD)&written, INFINITE, FALSE) == 0)
    13. +#endif
    14.                      {
    15.                          // Oops, we could not get the number of bytes writen, so return an error.
    16.                          *error = GetLastError();
     
    l_racher likes this.
  6. arturaz

    arturaz

    Joined:
    Mar 28, 2013
    Posts:
    30
    Case 1165837

    Have not tried the workaround yet.
     
  7. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Hi Tautvydas,

    We're using U2019.1.8 and also had this Windows 7 users got the il2cpp error and used your work-around. However we still have Windows 7 players getting a crash starting the game due to the Unity video player (we use a background video for our main menu). Is there a fix planned for this?

    https://store.steampowered.com/app/987020/DRONE_The_Game
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,527
    Can you start a new thread on that issue, just to not conflate the two things?
     
  9. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,527
    The fix for the originally discussed issue landed to 2018.4.4f1, 2019.1.10f1, 2019.2.0b10 and 2019.3.0a9.
     
  11. CliffCawley

    CliffCawley

    Joined:
    Mar 30, 2009
    Posts:
    21
    I'm in need of 2018.4.4 for this fix, but I can't find it on the download page. Only 2018.4.3f1 is available. Any idea where it is?
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,527
    It just got published today: https://unity3d.com/unity/qa/lts-releases
     
  13. CliffCawley

    CliffCawley

    Joined:
    Mar 30, 2009
    Posts:
    21
  14. Nivbot

    Nivbot

    Joined:
    Mar 21, 2015
    Posts:
    65
    Where in the file do I put this? I've tried it at the beginning and the end and I get an error saying the il2cpp did not run correctly when I try to build. I'm using 2019.2.0f1. Before changing file.cpp it built fine but I got an error that ild2cpp was not found or something to that effect but only when it was installed via an installer. When I ran it directly from the build folder it ran fine. So, I either can't use IL2CPP or can't obfuscate or what?
     
  15. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,527
    First of all, which Unity version are you on? This issue has been fixed for a while now so you shouldn't need to modify anything.
     
  16. Nivbot

    Nivbot

    Joined:
    Mar 21, 2015
    Posts:
    65
    I said in my post 2019.2.0f1. Well, I'm getting an error when I run the game. I forget exactly what is said now but it was short. Something like "IL2cpp not found" or not started. I'm not quite sure now. I'd have to compile again and make a install. Like I said in my post, it works in the build folder, but when I used an installer I got the IL2cpp error.

    *edit* and I don't believe I'm missing anything in the install as far as files go.
     
    Last edited: Oct 25, 2019
  17. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,527
    Sorry, I somehow managed to over read it.

    When you say "used an installer", could you elaborate what you mean by that?
     
  18. Nivbot

    Nivbot

    Joined:
    Mar 21, 2015
    Posts:
    65
    I added my compiled executable and proper folders and .dll to an installation builder and built an install file. When the installer was used to install the game I got the error after trying to play the game. I included the data folder and the Unity dll. and they were in the proper places. The .dll was in the same folder as the game.exe and the data folder was a subfolder of the same folder the .exe was in.
     
  19. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,527
    Did you make sure to include all the .DLL files? In particular, GameAssembly.dll? That error sounds like some files that were produced by Unity were not included into your installer.
     
  20. Nivbot

    Nivbot

    Joined:
    Mar 21, 2015
    Posts:
    65
    Where is GameAssembly.dll? The only .dll I know about and that was created was the UnityPlayer.dll
     
  21. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,527
    Unity puts GameAssembly.dll next to UnityPlayer.dll when you use IL2CPP scripting backend.
     
    Nivbot likes this.
  22. Nivbot

    Nivbot

    Joined:
    Mar 21, 2015
    Posts:
    65
  23. Nivbot

    Nivbot

    Joined:
    Mar 21, 2015
    Posts:
    65
    Well, I just tried it again and it did create it that time. It didn't before however, that is strange. Of course, I could have missed the file, but I thought I looked pretty carefully when making the install. Sorry, for all the time you wasted.
     
  24. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,527
    No worries. I suggest to have your installer take the whole folder produced by Unity build instead of picking individual files: they change from one Unity release to another (for instance, SymbolMap is no longer there).
     
  25. MrZeker

    MrZeker

    Joined:
    Nov 23, 2018
    Posts:
    227
    Hello, im experiencing this error on machines with windows 7 (64bit)
    im using Unity 2019.2.12f.1 . i havent tried the workaround yet
     
  26. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,527
    Can you confirm GameAssembly.so is present next to the executable?
     
  27. MrZeker

    MrZeker

    Joined:
    Nov 23, 2018
    Posts:
    227
    not GameAssembly.so, but GameAssembly.dll is next to the executable
     
  28. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,527
    Sorry, I was in Linux land when I wrote that reply :). I did mean GameAssembly.dll.

    Could you put that file to Google Drive and PM me the link to it? For some reason it fails to load on Windows 7 but I don't know why.
     
  29. MrZeker

    MrZeker

    Joined:
    Nov 23, 2018
    Posts:
    227
    the already built-game right?
     
  30. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,527