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

[SOLVED] IL2CPP build failed (2021.2.6)

Discussion in 'Windows' started by pan4ezzz, Dec 15, 2021.

  1. pan4ezzz

    pan4ezzz

    Joined:
    Jul 9, 2017
    Posts:
    19
    2021.2.6

    Building Library\Bee\artifacts\Stevedore\win10sdk_432e\.StevedoreVersion failed with output:
    Downloading: http://stevedore.hq.unity3d.com/r/u...635af568b0301f04d5b34153d67dccb8389a18f578.7z (/A).
    stevedore: 15.12.2021 8:36:33 - Failed to download (network error): http://stevedore.hq.unity3d.com/r/u...635af568b0301f04d5b34153d67dccb8389a18f578.7z
    ���������� ࠧ���� 㤠������ ���: 'stevedore.hq.unity3d.com'
    This server is for Unity employees only. Are you on the Unity network/VPN?
    HttpRequestException: �ந��諠 �訡�� �� ��ࠢ�� �����.
    WebException: ���������� ࠧ���� 㤠������ ���: 'stevedore.hq.unity3d.com'
    (Telemetry reference: /A)
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)


    ... Looks strange
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,797
    This does look odd - I don't think anything should be downloaded during an IL2CPP build. Can you provide more context from the Unity editor log file? I'd like to understand what action triggered this.
     
  3. pan4ezzz

    pan4ezzz

    Joined:
    Jul 9, 2017
    Posts:
    19
    Building Library\Bee\artifacts\Stevedore\win10sdk_432e\.StevedoreVersion failed with output:
    Downloading: http://stevedore.hq.unity3d.com/r/u...635af568b0301f04d5b34153d67dccb8389a18f578.7z (/A).
    stevedore: 15.12.2021 17:41:47 - Failed to download (network error): http://stevedore.hq.unity3d.com/r/u...635af568b0301f04d5b34153d67dccb8389a18f578.7z
    ���������� ࠧ���� 㤠������ ���: 'stevedore.hq.unity3d.com'
    This server is for Unity employees only. Are you on the Unity network/VPN?
    HttpRequestException: �ந��諠 �訡�� �� ��ࠢ�� �����.
    WebException: ���������� ࠧ���� 㤠������ ���: 'stevedore.hq.unity3d.com'
    (Telemetry reference: /A)
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)

    BuildFailedException: Incremental Player build failed!
    UnityEditor.Modules.BeeBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <52409df47eec4ff4a3e5a5be37682d54>:0)
    UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <52409df47eec4ff4a3e5a5be37682d54>:0)
    UnityEditor.WindowsStandalone.WinPlayerPostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at C:/buildslave/unity/build/PlatformDependent/WinPlayer/Extensions/Managed/WinPlayerPostProcessor.cs:33)
    UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.Int32 subtarget, 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 <52409df47eec4ff4a3e5a5be37682d54>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)

    Build completed with a result of 'Failed' in 97 seconds (96720 ms)
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)

    UnityEditor.BuildPlayerWindow+BuildMethodException: 49 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002d8] in <52409df47eec4ff4a3e5a5be37682d54>:0
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <52409df47eec4ff4a3e5a5be37682d54>:0
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)

    Errors come out at the very last stage, when you are waiting for success.
    The assembly already copied, but on startup:


    ---------------------------
    Fatal error
    ---------------------------
    Failed to load il2cpp
    ---------------------------
    OK
    ---------------------------
     
    Last edited: Dec 15, 2021
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,797
    Thanks for the additional details! This is actually a bug that we discovered internally. The fix is on the way to Unity releases for 2021.2 and later now.

    In the meantime, you can work around this issue by installing the Windows 10 SDK locally. The problem here happens when that SDK is not installed - the code is incorrectly trying to download it from an internal Unity server. Instead, you should see a better error message indicating that the SDK must be installed.
     
  5. pan4ezzz

    pan4ezzz

    Joined:
    Jul 9, 2017
    Posts:
    19
    Solved!
     
  6. unity_ADRUNKRUSSAIN

    unity_ADRUNKRUSSAIN

    Joined:
    Oct 4, 2022
    Posts:
    1
    Ok so how would I install that locally
     
  7. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,797
    I believe that his has been corrected - maybe try the latest Unity release if you have not done so yet.
     
  8. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    172
    Same is now happening in Unity 2022.3.9f1. Is this a new issue again?

    Many thanks
     
  9. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,797
  10. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    172
    Same happens in Unity 2022.3.10f1 !

    So to clarify what's going on, the build does succeed (no particular warning or error in the build log).
    When i try to lunch the executable, i get a windows error message box:

    Fatal error
    "Failed to load il2cpp"

    And here is what i get in Player.log
    Code (CSharp):
    1.  
    2. Could not load symbol il2cpp_class_is_inited : The specified procedure could not be found.
    3.  
    4. il2cpp: function il2cpp_class_is_inited not found
    5. Could not load symbol il2cpp_type_get_reflection_name : The specified procedure could not be found.
    6.  
    7. il2cpp: function il2cpp_type_get_reflection_name not found
    8. Could not load symbol il2cpp_custom_attrs_from_field : The specified procedure could not be found.
    9.  
    10. il2cpp: function il2cpp_custom_attrs_from_field not found
    11.  
     
  11. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    172
    Ok, after few digging, now i'm getting this error during compilation:

    Code (CSharp):
    1.  
    2. Building Library\Bee\artifacts\WinPlayerBuildProgram\3wbgm\jhruzj78hal3.obj failed with output:
    3. GenericMethods__71.cpp
    4. E:\XXXXXX\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\GenericMethods__71.cpp(4739): error C2440: 'type cast': cannot convert from 'NativeArray_1_tDB8B8DC66CC8E16ED6D9A8C75D2C1AFC80AC1E18' to 'NativeArray_1_tDB8B8DC66CC8E16ED6D9A8C75D2C1AFC80AC1E18 *'
    5. E:\XXXXXX\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\GenericMethods__71.cpp(4739): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
    6.  
    Any idea what can cause this issue?

    May thanks
     
  12. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,797
    This might mean there are two different .NET assemblies (DLL files) in the project that have NativeArray defined. That should not be the case, but I wonder if some assembly was incorrect duplicated maybe.
     
  13. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    172
    Any idea on how I can investigate this? Where to look?

    many thanks
     
  14. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,797
    Maybe take a look through the assemblies in the project. You can use a tool like ILSpy (https://github.com/icsharpcode/ILSpy) to inspect them, and check for types named NativeArray. You're looking for that type in the same namespace in two different assemblies.
     
  15. mshid

    mshid

    Joined:
    Apr 4, 2021
    Posts:
    2
    I am also getting similar problem with IL2CPP build.
    error C2440: 'return': cannot convert from 'MyAsset_1_t9165235CA7BFB5360877055AB03F871D160C3B36 *' to 'RuntimeObject *'
    note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast


    any idea?
    thanks
     
  16. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,797
    It seems like it might be the same issue. Can you follow the guidance about ILSpy given above?
     
  17. mshid

    mshid

    Joined:
    Apr 4, 2021
    Posts:
    2
    I have done that and still no clue. It's a unique type and no other type with similar name in the other assemblies.

    Maybe this can give a clue for you (error line for il2cppoutput):

    Code (CSharp):
    1. IL_00a8:
    2.     {
    3.         BinaryReader_t9A6D85F0FE9AE4EBB5E8D66997DFD1D84939E158* L_18 = ___0_p;
    4.         MyAsset_1_tAF573C2869355D66156EC40310F75F9ED09CA9E2* L_19;
    5.         L_19 = BakedEntryPoint_DeserializeType_MyAsset1_8_m69AF42B52DE8FC0308511B3A2C77678CF3D3E986(__this, L_18, NULL);
    6.         return L_19;
    7.     }
    The game run perfectly in editor, but can't build.
     
  18. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,797