【问题标题】:Exception: IL2CPP.exe did not run properly! Unity 3D build issue例外:IL2CPP.exe 没有正常运行! Unity 3D构建问题
【发布时间】:2020-05-21 21:52:16
【问题描述】:

我的统一版2019.3.12f1 我在构建我的 Android 游戏时遇到问题。当我想使用 IL2CPP 时,我无法构建我的游戏。在控制台中是这个错误:

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

Exception: C:\Program Files\Unity\Editor\Data\il2cpp/build/deploy/net471/il2cpp.exe did not run properly!
UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <ffcf2f9855fe46038192299154f37a45>:0)
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at <ffcf2f9855fe46038192299154f37a45>:0)
UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo, System.String workingDirectory) (at <ffcf2f9855fe46038192299154f37a45>:0)
UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data, System.String outputDirectory, System.String workingDirectory, System.Boolean platformSupportsManagedDebugging) (at <ffcf2f9855fe46038192299154f37a45>:0)
UnityEditorInternal.IL2CPPBuilder.Run () (at <ffcf2f9855fe46038192299154f37a45>:0)
UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <ffcf2f9855fe46038192299154f37a45>:0)
UnityEditor.Android.PostProcessor.Tasks.RunIl2Cpp.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <3167064085404657b0d6c498207da025>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <3167064085404657b0d6c498207da025>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <3167064085404657b0d6c498207da025>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <3167064085404657b0d6c498207da025>: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 <ffcf2f9855fe46038192299154f37a45>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

我该如何解决?

当我使用 Mono 时,构建工作正常。 当我使用 ILC2PP 时,构建不起作用。

【问题讨论】:

    标签: unity3d build


    【解决方案1】:

    问题是这个 Unity 资产名称在图片中有你的文件夹名称是..“VacuumShaders”我删除了这些资产我的项目在 IL2CPP 中构建成功

    【讨论】:

      【解决方案2】:

      我只是想补充一点,这个错误是由于意外将构建设置中的架构设置为 x86 而不是 x86_64 造成的

      【讨论】:

        【解决方案3】:

        我经历了整个过程(几天)来弄清楚为什么会发生这种情况,虽然解决方案“简单”,但我正在写下我的整个过程,希望它能为开发人员节省宝贵的时间。

        • 必须获得64bit version of sqlite(在此项目中使用 sqlite)
        • 必须获得64bit version of Newtonsoft.Json(处理来自网络的 json)
        • 必须将 unity 升级到可以使用 il2cpp SetLastWin32Error 错误修复构建 android64 的版本(大约 2021.2.11 之后的任何内容?截至撰写本文时,最新的是 2021.2.15f1)

        仍然出现构建错误,所以我

        • 创建了一个全新的项目并导出到 android64 - 成功
        • 比较项目之间的 android 设置
        • 项目之间的包设置比较
        • 比较项目之间的所有首选项设置
        • 将我的应用程序(分成两半)剥离到一无所有

        最终,有点明显的是,问题出在我现有的 android 应用程序中,unity 被导出到:

        • 直接构建到 apk 时(取消选中“构建设置”>“Android”中的“导出项目”)并取消选中“发布设置”>“构建”中的所有“自定义 _”时,构建停止抱怨 il2cpp 构建错误
        • 我不得不从头开始重写我的自定义 android 实现,才能找到罪魁祸首

        我从未发现具体问题,但我认为这与我的旧自定义应用程序中的统一基础有关。我最好的建议是从 android 构建一个干净的 64 构建版本重新开始,然后逐个移动您的自定义应用程序。

        【讨论】:

          猜你喜欢
          • 2020-03-22
          • 2021-10-13
          • 2019-12-24
          • 1970-01-01
          • 1970-01-01
          • 2017-06-17
          • 1970-01-01
          • 1970-01-01
          • 2020-03-07
          相关资源
          最近更新 更多