From a11ebecf93f2866844d4d2be7ca6ea2722d92e62 Mon Sep 17 00:00:00 2001 From: walon Date: Sat, 18 Jan 2025 22:55:37 +0800 Subject: [PATCH] [fix] fixe the bug that preserving UnityEngine.PerformanceReportingModule when generating link.xml would cause the Android app built with Unity 2019 to crash on startup. --- Editor/Link/Analyzer.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Editor/Link/Analyzer.cs b/Editor/Link/Analyzer.cs index 0ddfded..c2ca3e9 100644 --- a/Editor/Link/Analyzer.cs +++ b/Editor/Link/Analyzer.cs @@ -43,6 +43,11 @@ namespace HybridCLR.Editor.Link var assCollector = new AssemblyCache(_resolver); foreach (string unityEngineDll in Directory.GetFiles(unityEngineDllPath, "UnityEngine.*.dll", SearchOption.AllDirectories)) { + // because of bug of unity 2019.4.x, preserving types in this dll will cause crash in android build + if (unityEngineDll.EndsWith("UnityEngine.PerformanceReportingModule.dll", StringComparison.InvariantCulture)) + { + continue; + } ModuleDefMD mod = assCollector.LoadModuleFromFileWithoutCache(unityEngineDll); foreach (TypeDef type in mod.GetTypes()) {