{"record":{"id":"144676c3e20e747d","repo":"egametang/ET","slug":"you-have-not-initialized-hybridclr-please-install","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/BuildProcessors/CheckSettings.cs","lineNumber":60,"sourceCode":"                }\n            }\n            if (!globalSettings.enable)\n            {\n                return;\n            }\n            BuildTargetGroup buildTargetGroup = BuildPipeline.GetBuildTargetGroup(EditorUserBuildSettings.activeBuildTarget);\n            ScriptingImplementation curScriptingImplementation = PlayerSettings.GetScriptingBackend(NamedBuildTarget.FromBuildTargetGroup(buildTargetGroup));\n            ScriptingImplementation targetScriptingImplementation = ScriptingImplementation.IL2CPP;\n            if (curScriptingImplementation != targetScriptingImplementation)\n            {\n                Debug.LogError($\"[CheckSettings] current ScriptingBackend:{curScriptingImplementation}，have been switched to:{targetScriptingImplementation} automatically\");\n                PlayerSettings.SetScriptingBackend(NamedBuildTarget.FromBuildTargetGroup(buildTargetGroup), targetScriptingImplementation);\n            }\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\n            if (installer.PackageVersion != installer.InstalledLibil2cppVersion)\n            {\n                throw new BuildFailedException($\"You must run `HybridCLR/Installer` after upgrading package\");\n            }\n\n            HybridCLRSettings gs = SettingsUtil.HybridCLRSettings;\n            if (((gs.hotUpdateAssemblies?.Length + gs.hotUpdateAssemblyDefinitions?.Length) ?? 0) == 0)\n            {\n                Debug.LogWarning(\"[CheckSettings] No hot update modules configured in HybridCLRSettings\");\n            }\n\n            if (!DisableMethodBridgeDevelopmentFlagChecking)\n            {\n                string methodBridgeFile = $\"{SettingsUtil.GeneratedCppDir}/MethodBridge.cpp\";\n                var match = Regex.Match(File.ReadAllText(methodBridgeFile), @\"// DEVELOPMENT=(\\d)\");\n                if (match.Success)","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/egametang/ET/blob/5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f/Packages/cn.etetet.hybridclr/Scripts/Editor/Share/BuildProcessors/CheckSettings.cs#L42-L78","documentation":"Thrown by CheckSettings.OnPreprocessBuild (IPreprocessBuildWithReport callback) when InstallerController.HasInstalledHybridCLR() returns false. This runs at the start of every build when HybridCLR is enabled. HasInstalledHybridCLR checks whether the local libil2cpp has been patched with HybridCLR's modifications; if not, the build would fail or produce non-functional hot-update support, so it aborts early with BuildFailedException.","triggerScenarios":"Building the project (any platform) with HybridCLR enabled in HybridCLRSettings, but the HybridCLR installer has never been run or its modifications were removed (e.g. Unity reinstalled, library folder cleared, il2cpp re-cached). The check fires during the build preprocessing phase.","commonSituations":"Fresh clone of a project using HybridCLR without running the installer; deleting the Library folder which clears the installed state; upgrading Unity which replaces the bundled libil2cpp and wipes HybridCLR patches; switching to a new machine without running the installer.","solutions":["In the Unity editor menu, go to HybridCLR > Installer and click Install, then retry the build.","If the installer reports errors, check the console for the specific failure (network, permissions, git) and resolve it.","After upgrading Unity, always re-run the installer since the libil2cpp source is replaced.","For CI/CD, add a step that runs the installer via the editor API before building."],"exampleFix":"// workflow fix — no code change needed:\n// Unity menu > HybridCLR > Installer > Install\n// then rebuild.\n\n// for CI/CD automation, run this in batchmode before building:\n// -executeMethod HybridCLR.Editor.Installer.InstallController.Install\n\n// before — build fails\n// throw new BuildFailedException(\"You have not initialized HybridCLR...\");\n\n// after — check and guide the user\nif (!installer.HasInstalledHybridCLR())\n{\n    Debug.LogError(\"HybridCLR not installed. Run menu: HybridCLR > Installer > Install, then rebuild.\");\n    return; // skip build or prompt\n}","handlingStrategy":"validation","validationCode":"var installer = new Installer.InstallerController();\nif (!installer.HasInstalledHybridCLR())\n{\n    Debug.LogError(\"HybridCLR is not installed. Run Unity menu: HybridCLR > Installer > Install, then rebuild.\");\n    return; // do not proceed with the build\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    // Build triggers CheckSettings.OnPreprocessBuild internally\n    BuildPipeline.BuildPlayer(scenes, outputPath, buildTarget, buildOptions);\n}\ncatch (BuildFailedException ex) when (ex.Message.Contains(\"not initialized HybridCLR\"))\n{\n    Debug.LogError(\"HybridCLR not installed. Open HybridCLR > Installer and click Install, then rebuild.\");\n}","preventionTips":["After cloning a HybridCLR project, always run HybridCLR > Installer before building.","After deleting the Library folder or reinstalling Unity, re-run the installer.","For CI/CD pipelines, add an installer step via -executeMethod before the build command.","Document the installer step in project onboarding instructions."],"tags":["hybridclr","installer","build-preprocessing","libil2cpp","initialization"],"backgroundTag":null,"analyzedSha":"5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f","analyzedAt":"2026-08-13T21:10:40.377Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}