{"record":{"id":"8f9a670dd0c380d5","repo":"egametang/ET","slug":"type-typesig-definition-could-not-be-found-plea","errorCode":null,"errorMessage":"type:{typeSig} definition could not be found. Please try `HybridCLR/Genergate/LinkXml`, then Build once to generate the AOT dll, and then regenerate the bridge function","messagePattern":"type:(.+?) definition could not be found\\. Please try `HybridCLR/Genergate/LinkXml`, then Build once to generate the AOT dll, and then regenerate the bridge function","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"Packages/cn.etetet.hybridclr/Scripts/Editor/Share/MethodBridge/Generator.cs","lineNumber":367,"sourceCode":"                case ElementType.U:\n                case ElementType.Ptr:\n                case ElementType.ByRef:\n                case ElementType.FnPtr:\n                case ElementType.TypedByRef: return true;\n                case ElementType.String:\n                case ElementType.Class:\n                case ElementType.Array:\n                case ElementType.SZArray:\n                case ElementType.Object:\n                case ElementType.Module:\n                case ElementType.Var:\n                case ElementType.MVar: return false;\n                case ElementType.ValueType:\n                {\n                    TypeDef typeDef = typeSig.ToTypeDefOrRef().ResolveTypeDef();\n                    if (typeDef == null)\n                    {\n                        throw new Exception($\"type:{typeSig} definition could not be found. Please try `HybridCLR/Genergate/LinkXml`, then Build once to generate the AOT dll, and then regenerate the bridge function\");\n                    }\n                    if (typeDef.IsEnum)\n                    {\n                        return true;\n                    }\n                    return CalculateAnalyzeTypeInfoBasic(GetSharedTypeInfo(typeSig)).blittable;\n                }\n                case ElementType.GenericInst:\n                {\n                    GenericInstSig gis = (GenericInstSig)typeSig;\n                    if (!gis.GenericType.IsValueType)\n                    {\n                        return false;\n                    }\n                    TypeDef typeDef = gis.GenericType.ToTypeDefOrRef().ResolveTypeDef();\n                    if (typeDef.IsEnum)\n                    {\n                        return true;","sourceCodeStart":349,"sourceCodeEnd":385,"githubUrl":"https://github.com/egametang/ET/blob/5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f/Packages/cn.etetet.hybridclr/Scripts/Editor/Share/MethodBridge/Generator.cs#L349-L385","documentation":"Thrown by the blittable analysis in Generator when a ValueType type signature's TypeDef cannot be resolved via ResolveTypeDef. Unlike the MetaUtil variant (191/192), this message includes an actionable remediation: generate link.xml, build once to produce the AOT DLL, then regenerate the bridge function.","triggerScenarios":"During blittable computation, the ElementType.ValueType case calls typeSig.ToTypeDefOrRef().ResolveTypeDef(). A null TypeDef -- typically because the AOT assembly containing the value type was stripped away -- triggers the exception with the link.xml hint.","commonSituations":"IL2CPP stripping removed a value type's defining assembly because nothing in the AOT build referenced it; link.xml does not preserve the assembly or type; running MethodBridge generation before a build that materializes the AOT DLLs.","solutions":["Run HybridCLR/Generate/LinkXml to regenerate link.xml with current preserve rules.","Perform a Unity build once so IL2CPP produces the trimmed AOT DLLs containing the type.","Run HybridCLR/Generate/AotDlls then HybridCLR/Generate/MethodBridge to regenerate bridges against complete metadata.","If the type is in a third-party assembly, add an explicit preserve entry to link.xml for that assembly."],"exampleFix":"<!-- link.xml: preserve the assembly that defines the missing value type -->\n<linker>\n  <assembly fullname=\"MyGame.Shared\" preserve=\"all\"/>\n</linker>","handlingStrategy":"validation","validationCode":"// Before blittable analysis, verify the value type assembly is preserved\nvar td = typeSig.ToTypeDefOrRef().ResolveTypeDef();\nif (td == null)\n    Debug.LogError(\"Cannot resolve type -- regenerate link.xml and rebuild for AOT DLLs.\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run HybridCLR/Generate/LinkXml and perform a build before MethodBridge generation.","Add explicit preserve entries for assemblies defining value types used at the boundary.","Regenerate AOT DLLs whenever link.xml or dependencies change."],"tags":["hybridclr","method-bridge","link-xml","blittable","aot"],"backgroundTag":null,"analyzedSha":"5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f","analyzedAt":"2026-08-13T21:10:40.377Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}