Unity I2CPP 输出报错

报错信息:

Exception: D:\Program Files\Unity\hub\2019.4.16f1c1\Editor\Data\il2cpp/build/deploy/net471/il2cpp.exe did not run properly!

Failed running "D:\Program Files\Unity\hub\2019.4.16f1c1\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="x64" --configuration="Release" --outputpath="E:\Workspaces\Unity\Test\Temp/StagingArea/Data\Native\GameAssembly.dll" --cachedirectory="E:\Workspaces\Unity\Test\Assets\..\Library/il2cpp_cache" --profiler-report --map-file-parser="D:/Program Files/Unity/hub/2019.4.16f1c1/Editor/Data/Tools/MapFileParser/MapFileParser.exe" --directory=E:/Workspaces/Unity/Test/Temp/StagingArea/Data/Managed --generatedcppdir=E:/Workspaces/Unity/Test/Temp/StagingArea/Data/il2cppOutput  

stdout:
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:
        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)
        Visual Studio 2015 installation is found by looking at "SOFTWARE\Microsoft\VisualStudio\14.0_Config\InstallDir" in the registry
        Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry

        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/)
        Visual Studio 2017 (or newer) installation is found using Microsoft.VisualStudio.Setup.Configuration COM APIs
        Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry


   �� Unity.IL2CPP.Building.CppProgramBuilder.ThrowIfCannotBuildInCurrentEnvironment()
   �� Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
   �� il2cpp.Program.DoRun(String[] args, List`1 foundAssemblies)
   �� il2cpp.Program.Run(String[] args, Boolean setInvariantCulture)
   �� il2cpp.Program.Main(String[] args)
stderr:

δ��������쳣:  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:
        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)
        Visual Studio 2015 installation is found by looking at "SOFTWARE\Microsoft\VisualStudio\14.0_Config\InstallDir" in the registry
        Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry

        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/)
        Visual Studio 2017 (or newer) installation is found using Microsoft.VisualStudio.Setup.Configuration COM APIs
        Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry


   �� Unity.IL2CPP.Building.CppProgramBuilder.ThrowIfCannotBuildInCurrentEnvironment()
   �� Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
   �� il2cpp.Program.DoRun(String[] args, List`1 foundAssemblies)
   �� il2cpp.Program.Run(String[] args, Boolean setInvariantCulture)
   �� il2cpp.Program.Main(String[] args)

UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <599cc8297d774c7eab3d57de775dc8cb>:0)
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at <599cc8297d774c7eab3d57de775dc8cb>:0)
UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo, System.String workingDirectory) (at <599cc8297d774c7eab3d57de775dc8cb>:0)
UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data, System.String outputDirectory, System.String workingDirectory, System.Boolean platformSupportsManagedDebugging) (at <599cc8297d774c7eab3d57de775dc8cb>:0)
UnityEditorInternal.IL2CPPBuilder.Run () (at <599cc8297d774c7eab3d57de775dc8cb>:0)
UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <599cc8297d774c7eab3d57de775dc8cb>:0)
DesktopStandalonePostProcessor.SetupStagingArea (UnityEditor.Modules.BuildPostProcessArgs args, System.Collections.Generic.HashSet`1[T] filesToNotOverwrite) (at <599cc8297d774c7eab3d57de775dc8cb>:0)
DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <599cc8297d774c7eab3d57de775dc8cb>:0)
Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <599cc8297d774c7eab3d57de775dc8cb>:0)
UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <599cc8297d774c7eab3d57de775dc8cb>:0)
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 <599cc8297d774c7eab3d57de775dc8cb>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

问题原因:未安装组件

C++ compilers and Windows 10 SDK

解决方案:VSInstaller 中的C++开发分项中  安装 win10SDK

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值