{"record":{"id":"cb171548d6f3b290","repo":"egametang/ET","slug":"you-have-not-initialized-hybridclr-please-install-cb1715","errorCode":null,"errorMessage":"You have not initialized HybridCLR, please install it via menu 'HybridCLR/Installer'","messagePattern":"You have not initialized HybridCLR, please install it via menu 'HybridCLR/Installer'","errorType":"exception","errorClass":"BuildFailedException","httpStatus":null,"severity":"critical","filePath":"Packages/cn.etetet.hybridclr/Scripts/Editor/Share/Commands/PrebuildCommand.cs","lineNumber":22,"sourceCode":"using System.Text;\nusing System.Threading.Tasks;\nusing UnityEditor;\nusing UnityEditor.Build;\n\nnamespace HybridCLR.Editor.Commands\n{\n    public static class PrebuildCommand\n    {\n        /// <summary>\n        /// 按照必要的顺序，执行所有生成操作，适合打包前操作\n        /// </summary>\n        [MenuItem(\"HybridCLR/Generate/All\", priority = 200)]\n        public static void GenerateAll()\n        {\n            var installer = new Installer.InstallerController();\n            if (!installer.HasInstalledHybridCLR())\n            {\n                throw new BuildFailedException($\"You have not initialized HybridCLR, please install it via menu 'HybridCLR/Installer'\");\n            }\n            BuildTarget target = EditorUserBuildSettings.activeBuildTarget;\n            CompileDllCommand.CompileDll(target, EditorUserBuildSettings.development);\n            Il2CppDefGeneratorCommand.GenerateIl2CppDef();\n\n            // 这几个生成依赖HotUpdateDlls\n            LinkGeneratorCommand.GenerateLinkXml(target);\n\n            // 生成裁剪后的aot dll\n            StripAOTDllCommand.GenerateStripedAOTDlls(target);\n\n            // 桥接函数生成依赖于AOT dll，必须保证已经build过，生成AOT dll\n            MethodBridgeGeneratorCommand.GenerateMethodBridgeAndReversePInvokeWrapper(target);\n            AOTReferenceGeneratorCommand.GenerateAOTGenericReference(target);\n        }\n    }\n}\n","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/egametang/ET/blob/5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f/Packages/cn.etetet.hybridclr/Scripts/Editor/Share/Commands/PrebuildCommand.cs#L4-L40","documentation":"Thrown by PrebuildCommand.GenerateAll when InstallerController.HasInstalledHybridCLR() returns false. HybridCLR requires a one-time installation that clones and patches the local IL2CPP toolchain; Generate/All depends on that toolchain being present.","triggerScenarios":"Selecting the menu HybridCLR/Generate/All before ever running HybridCLR/Installer. The installer check probes whether the local HybridCLR data directory and patched libil2cpp exist.","commonSituations":"Fresh project checkout on a new machine or CI agent where HybridCLR was never installed; the HybridCLRData folder was deleted or never committed (it is typically gitignored); Unity was upgraded to a new minor version invalidating the previous install.","solutions":["Run HybridCLR/Installer from the Unity menu and wait for it to report success, then re-run Generate/All.","If on CI, add an installation step that runs before any Generate command, or cache the HybridCLRData directory across runs.","After a Unity upgrade, re-run the installer -- old installs are version-specific and will not satisfy HasInstalledHybridCLR for the new version."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"var installer = new Installer.InstallerController();\nif (!installer.HasInstalledHybridCLR())\n    Debug.LogError(\"HybridCLR not installed -- run HybridCLR/Installer before generating code.\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add the HybridCLR install step to your project setup guide and CI pipeline.","Cache or commit-verify the HybridCLRData directory presence before Generate/All.","After every Unity version upgrade, re-run the installer as a mandatory step."],"tags":["hybridclr","installer","setup","prebuild"],"backgroundTag":null,"analyzedSha":"5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f","analyzedAt":"2026-08-13T21:10:40.377Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}