egametang/ET · error · Exception
no aot assembly found. please run `HybridCLR/Generate/All` o
Error message
no aot assembly found. please run `HybridCLR/Generate/All` or `HybridCLR/Generate/AotDlls` to generate aot dlls before runing `HybridCLR/Generate/MethodBridge`
What it means
Thrown by MethodBridgeGeneratorCommand.GenerateMethodBridgeAndReversePInvokeWrapper when the post-IL2CPP-strip AOT directory contains no DLLs. The method bridge generator must walk AOT assembly metadata to compute the bridging/signature-sharing tables; it cannot proceed without trimmed AOT assemblies.
Source
Thrown at Packages/cn.etetet.hybridclr/Scripts/Editor/Share/Commands/MethodBridgeGeneratorCommand.cs:65
Debug.LogFormat("[MethodBridgeGeneratorCommand] output:{0}", outputFile);
}
[MenuItem("HybridCLR/Generate/MethodBridgeAndReversePInvokeWrapper", priority = 101)]
public static void GenerateMethodBridgeAndReversePInvokeWrapper()
{
BuildTarget target = EditorUserBuildSettings.activeBuildTarget;
GenerateMethodBridgeAndReversePInvokeWrapper(target);
}
public static void GenerateMethodBridgeAndReversePInvokeWrapper(BuildTarget target)
{
string aotDllDir = SettingsUtil.GetAssembliesPostIl2CppStripDir(target);
List<string> aotAssemblyNames = Directory.Exists(aotDllDir) ?
Directory.GetFiles(aotDllDir, "*.dll", SearchOption.TopDirectoryOnly).Select(Path.GetFileNameWithoutExtension).ToList()
: new List<string>();
if (aotAssemblyNames.Count == 0)
{
throw new Exception($"no aot assembly found. please run `HybridCLR/Generate/All` or `HybridCLR/Generate/AotDlls` to generate aot dlls before runing `HybridCLR/Generate/MethodBridge`");
}
AssemblyReferenceDeepCollector collector = new AssemblyReferenceDeepCollector(MetaUtil.CreateAOTAssemblyResolver(target), aotAssemblyNames);
var methodBridgeAnalyzer = new Analyzer(new Analyzer.Options
{
MaxIterationCount = Math.Min(20, SettingsUtil.HybridCLRSettings.maxMethodBridgeGenericIteration),
Collector = collector,
});
methodBridgeAnalyzer.Run();
List<string> hotUpdateDlls = SettingsUtil.HotUpdateAssemblyNamesExcludePreserved;
var cache = new AssemblyCache(MetaUtil.CreateHotUpdateAndAOTAssemblyResolver(target, hotUpdateDlls));
var reversePInvokeAnalyzer = new MonoPInvokeCallbackAnalyzer(cache, hotUpdateDlls);
reversePInvokeAnalyzer.Run();
var calliAnalyzer = new CalliAnalyzer(cache, hotUpdateDlls);View on GitHub (pinned to 5cab01f7a8)
Solutions
- Run HybridCLR/Generate/All to run the full pipeline (compile DLL, generate link.xml, strip AOT, then bridge) in the correct order.
- If running steps individually, always run HybridCLR/Generate/AotDlls before HybridCLR/Generate/MethodBridge.
- Ensure the active build target is set before generation, since the strip output is keyed by target.
Defensive patterns
Strategy: validation
Validate before calling
string aotDir = SettingsUtil.GetAssembliesPostIl2CppStripDir(EditorUserBuildSettings.activeBuildTarget);
if (!Directory.Exists(aotDir) || Directory.GetFiles(aotDir, "*.dll").Length == 0)
throw new InvalidOperationException("Run HybridCLR/Generate/AotDlls before MethodBridge."); Prevention
- Run generation steps in dependency order: CompileDll, LinkXml, AotDlls, AOTGenericReference, MethodBridge.
- Use HybridCLR/Generate/All in automation to guarantee correct ordering.
- Tag the strip output with build target + Unity version to detect stale caches.
When it happens
Trigger: Invoking HybridCLR/Generate/MethodBridge (or Generate/All) when the strip output directory for the active BuildTarget is missing or empty -- identical precondition to error 181 but reached during the method-bridge phase.
Common situations: CI pipeline that runs only MethodBridge generation without the prior strip step; a stale HybridCLRData folder after a Unity version upgrade; build target changed between strip and bridge generation.
Related errors
- no aot assembly found. please run `HybridCLR/Generate/All` o
- type:{typeSig} definition could not be found. Please try `Hy
- GenerateStripedAOTDlls failed
- resolve AOT dll:{assemblyName} failed! Please make sure that
- type:{a} definition could not be found
AI-assisted analysis of egametang/ET@5cab01f7a8 (2026-08-13).
Data as JSON: /api/errors/d5c91028cd56628d.
Report an issue: GitHub.