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.

Bug Cannot build IL2cpp to Windows "il2cpp.exe did not run properly!"

Discussion in 'Editor & General Support' started by Valakinhas, Feb 1, 2021.

  1. Valakinhas

    Valakinhas

    Joined:
    Oct 3, 2017
    Posts:
    6
    the error persists in an empty project (URP)

    Code (CSharp):
    1. Exception: C:\Program Files\Unity\Hub\Editor\2019.4.18f1\Editor\Data\il2cpp/build/deploy/net471/il2cpp.exe did not run properly!
    2.  
    3. Failed running "C:\Program Files\Unity\Hub\Editor\2019.4.18f1\Editor\Data\il2cpp/build/deploy/net471/il2cpp.exe" --convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="unityaot" --compile-cpp --libil2cpp-static --platform="WindowsDesktop" --architecture="x86" --configuration="Release" --outputpath="C:\Users\Weverton\Documents\Dinosauria\Temp/StagingArea/Data\Native\GameAssembly.dll" --cachedirectory="C:\Users\Weverton\Documents\Dinosauria\Assets\..\Library/il2cpp_cache" --profiler-report --map-file-parser="C:/Program Files/Unity/Hub/Editor/2019.4.18f1/Editor/Data/Tools/MapFileParser/MapFileParser.exe" --directory=C:/Users/Weverton/Documents/Dinosauria/Temp/StagingArea/Data/Managed --generatedcppdir=C:/Users/Weverton/Documents/Dinosauria/Temp/StagingArea/Data/il2cppOutput
    4.  
    5. stdout:
    6. il2cpp.exe didn't catch exception: System.InvalidOperationException: C++ code builder is unable to build C++ code. In order to build C++ code for Windows Desktop, you must have one of these installed:
    7.        Visual Studio 2015 with C++ compilers and Windows 10 SDK (it cannot build C++ code because it is not installed or missing C++ workload component)
    8.        Visual Studio 2015 installation is found by looking at "SOFTWARE\Microsoft\VisualStudio\14.0_Config\InstallDir" in the registry
    9.        Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry
    10.  
    11.        Visual Studio 2017 (or newer) with C++ compilers and Windows 10 SDK (it cannot build C++ code because Windows 10 SDK is not installed. You can install from here: https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk/)
    12.        Visual Studio 2017 (or newer) installation is found using Microsoft.VisualStudio.Setup.Configuration COM APIs
    13.        Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry
    14.  
    15.  
    16.   em Unity.IL2CPP.Building.CppProgramBuilder.ThrowIfCannotBuildInCurrentEnvironment()
    17.   em Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    18.   em il2cpp.Program.DoRun(String[] args, List`1 foundAssemblies)
    19.   em il2cpp.Program.Run(String[] args, Boolean setInvariantCulture)
    20.   em il2cpp.Program.Main(String[] args)
    21. stderr:
    22.  
    23. Exce��o Sem Tratamento: System.InvalidOperationException: C++ code builder is unable to build C++ code. In order to build C++ code for Windows Desktop, you must have one of these installed:
    24.        Visual Studio 2015 with C++ compilers and Windows 10 SDK (it cannot build C++ code because it is not installed or missing C++ workload component)
    25.        Visual Studio 2015 installation is found by looking at "SOFTWARE\Microsoft\VisualStudio\14.0_Config\InstallDir" in the registry
    26.        Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry
    27.  
    28.        Visual Studio 2017 (or newer) with C++ compilers and Windows 10 SDK (it cannot build C++ code because Windows 10 SDK is not installed. You can install from here: https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk/)
    29.        Visual Studio 2017 (or newer) installation is found using Microsoft.VisualStudio.Setup.Configuration COM APIs
    30.        Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry
    31.  
    32.  
    33.   em Unity.IL2CPP.Building.CppProgramBuilder.ThrowIfCannotBuildInCurrentEnvironment()
    34.   em Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    35.   em il2cpp.Program.DoRun(String[] args, List`1 foundAssemblies)
    36.   em il2cpp.Program.Run(String[] args, Boolean setInvariantCulture)
    37.   em il2cpp.Program.Main(String[] args)
    38.  
    39. UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <afa5b9a1793446ff98b741dc036c4c6e>:0)
    40. UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at <afa5b9a1793446ff98b741dc036c4c6e>:0)
    41. UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo, System.String workingDirectory) (at <afa5b9a1793446ff98b741dc036c4c6e>:0)
    42. UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data, System.String outputDirectory, System.String workingDirectory, System.Boolean platformSupportsManagedDebugging) (at <afa5b9a1793446ff98b741dc036c4c6e>:0)
    43. UnityEditorInternal.IL2CPPBuilder.Run () (at <afa5b9a1793446ff98b741dc036c4c6e>:0)
    44. UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <afa5b9a1793446ff98b741dc036c4c6e>:0)
    45. DesktopStandalonePostProcessor.SetupStagingArea (UnityEditor.Modules.BuildPostProcessArgs args, System.Collections.Generic.HashSet`1[T] filesToNotOverwrite) (at <afa5b9a1793446ff98b741dc036c4c6e>:0)
    46. DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <afa5b9a1793446ff98b741dc036c4c6e>:0)
    47. Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
    48. DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <afa5b9a1793446ff98b741dc036c4c6e>:0)
    49. UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <afa5b9a1793446ff98b741dc036c4c6e>:0)
    50. 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 <afa5b9a1793446ff98b741dc036c4c6e>:0)
    51. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)