From 29ef9a135288686492775e725b2e0f026ef0652e Mon Sep 17 00:00:00 2001 From: Tomas Date: Wed, 21 Oct 2026 16:51:06 +0300 Subject: [PATCH 1/6] Fix warning UAL0013: A type with static fields, automatic properties or events must have a Unity.Scripting.LifecycleManagement.AutoStaticsCleanup or NoAutoStaticsCleanup attribute. AutoStaticsCleanup additionally requires the type and all its containing types to be declared partial. for Unity 7 --- .../Editor/AndroidLogcat.cs | 8 ++- .../Editor/AndroidLogcatConsoleWindow.cs | 4 +- .../Editor/AndroidLogcatDeviceQuery.cs | 2 +- .../Editor/AndroidLogcatEntry.cs | 2 + .../Editor/AndroidLogcatIPWindow.cs | 2 +- .../Editor/AndroidLogcatInputs.cs | 2 + .../Editor/AndroidLogcatInternalLog.cs | 2 + .../Editor/AndroidLogcatLayoutViewerWindow.cs | 6 +- .../AndroidLogcatProjectSettingsProvider.cs | 2 +- .../Editor/AndroidLogcatQueryLayout.cs | 2 +- .../AndroidLogcatScreenCaptureWindow.cs | 20 +++--- .../AndroidLogcatSendTrimMemoryUsage.cs | 2 + .../Editor/AndroidLogcatSettings.cs | 4 +- .../Editor/AndroidLogcatSettingsProvider.cs | 18 ++--- .../Editor/AndroidLogcatStyles.cs | 66 ++++++++++--------- .../Editor/AndroidLogcatTags.cs | 2 +- .../Editor/AndroidTools/AndroidBridge.cs | 5 ++ .../Editor/LifecycleManagementPolyfill.cs | 14 ++++ .../LifecycleManagementPolyfill.cs.meta | 11 ++++ .../Editor/Tasks/AndroidLogcatDispatcher.cs | 2 + .../Editor/UI/AndroidLogcatReordableList.cs | 4 +- .../AndroidLogcatInitializationTests.cs | 2 + .../AndroidLogcatMessageProviderTests.cs | 6 +- 23 files changed, 119 insertions(+), 69 deletions(-) create mode 100644 com.unity.mobile.android-logcat/Editor/LifecycleManagementPolyfill.cs create mode 100644 com.unity.mobile.android-logcat/Editor/LifecycleManagementPolyfill.cs.meta diff --git a/com.unity.mobile.android-logcat/Editor/AndroidLogcat.cs b/com.unity.mobile.android-logcat/Editor/AndroidLogcat.cs index f9bd4df9..25cfb9fe 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidLogcat.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidLogcat.cs @@ -4,9 +4,11 @@ using System.Linq; using UnityEngine; using System.Text; +using Unity.Scripting.LifecycleManagement; namespace Unity.Android.Logcat { + [NoAutoStaticsCleanup] internal class AndroidLogcat { private AndroidLogcatRuntimeBase m_Runtime; @@ -458,12 +460,12 @@ internal string LogPrintFormat get { return m_Device.SupportYearFormat ? kYearTime : kThreadTime; } } - internal static Regex m_CrashMessageRegex = new Regex(@"^\s*#\d{2}\s*pc\s([a-fA-F0-9]{8}).*(libunity\.so|libmain\.so)", RegexOptions.Compiled); + internal static readonly Regex m_CrashMessageRegex = new Regex(@"^\s*#\d{2}\s*pc\s([a-fA-F0-9]{8}).*(libunity\.so|libmain\.so)", RegexOptions.Compiled); // Regex for messages produced via 'adb logcat -s -v year *:V' - internal static Regex m_LogCatEntryYearRegex = new Regex(@"(?\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}\.\d{3})\s+(?\d+)\s+(?\d+)\s+(?[VDIWEFS])\s+(?.+?)\s*:\s(?.*)", RegexOptions.Compiled); + internal static readonly Regex m_LogCatEntryYearRegex = new Regex(@"(?\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}\.\d{3})\s+(?\d+)\s+(?\d+)\s+(?[VDIWEFS])\s+(?.+?)\s*:\s(?.*)", RegexOptions.Compiled); // Regex for messages produced via 'adb logcat -s -v threadtime *:V' - internal static Regex m_LogCatEntryThreadTimeRegex = new Regex(@"(?\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}\.\d{3})\s+(?\d+)\s+(?\d+)\s+(?[VDIWEFS])\s+(?.+?)\s*:\s(?.*)", RegexOptions.Compiled); + internal static readonly Regex m_LogCatEntryThreadTimeRegex = new Regex(@"(?\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}\.\d{3})\s+(?\d+)\s+(?\d+)\s+(?[VDIWEFS])\s+(?.+?)\s*:\s(?.*)", RegexOptions.Compiled); internal static readonly int kUnityHashCode = "Unity".GetHashCode(); diff --git a/com.unity.mobile.android-logcat/Editor/AndroidLogcatConsoleWindow.cs b/com.unity.mobile.android-logcat/Editor/AndroidLogcatConsoleWindow.cs index 5ce27cda..273b00ec 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidLogcatConsoleWindow.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidLogcatConsoleWindow.cs @@ -5,9 +5,11 @@ using UnityEngine; using UnityEditor; using UnityEditor.IMGUI.Controls; +using Unity.Scripting.LifecycleManagement; namespace Unity.Android.Logcat { + [NoAutoStaticsCleanup] internal partial class AndroidLogcatConsoleWindow : EditorWindow, IHasCustomMenu { private GUIContent kAutoRunText = new GUIContent(L10n.Tr("Auto Run"), L10n.Tr("Automatically launch logcat window during build & run.")); @@ -40,7 +42,7 @@ private IReadOnlyList ProcessesForSelectedDevice private AndroidLogcatInputs m_Inputs; private DateTime m_TimeOfLastMemoryRequest; - private static string kAutoShowLogcatDuringBuildRun = "AutoShowLogcatDuringBuildRun"; + private const string kAutoShowLogcatDuringBuildRun = "AutoShowLogcatDuringBuildRun"; private ProcessInformation SelectedProcess { diff --git a/com.unity.mobile.android-logcat/Editor/AndroidLogcatDeviceQuery.cs b/com.unity.mobile.android-logcat/Editor/AndroidLogcatDeviceQuery.cs index 784d9f85..ebb933d0 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidLogcatDeviceQuery.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidLogcatDeviceQuery.cs @@ -25,7 +25,7 @@ internal struct DeviceInfo abstract class AndroidLogcatDeviceQueryBase { - internal static Regex kDeviceInfoRegex = new Regex(@"(?^\S+)\s+(?\S+$)"); + internal static readonly Regex kDeviceInfoRegex = new Regex(@"(?^\S+)\s+(?\S+$)"); protected IAndroidLogcatDevice m_SelectedDevice; protected Dictionary m_Devices = new Dictionary(); diff --git a/com.unity.mobile.android-logcat/Editor/AndroidLogcatEntry.cs b/com.unity.mobile.android-logcat/Editor/AndroidLogcatEntry.cs index 28c82e6d..c20578fb 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidLogcatEntry.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidLogcatEntry.cs @@ -1,7 +1,9 @@ using System; +using Unity.Scripting.LifecycleManagement; namespace Unity.Android.Logcat { + [NoAutoStaticsCleanup] class LogcatEntry { [Flags] diff --git a/com.unity.mobile.android-logcat/Editor/AndroidLogcatIPWindow.cs b/com.unity.mobile.android-logcat/Editor/AndroidLogcatIPWindow.cs index 175f0bb4..26553b7e 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidLogcatIPWindow.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidLogcatIPWindow.cs @@ -6,7 +6,7 @@ namespace Unity.Android.Logcat { internal class AndroidLogcatIPWindow : EditorWindow { - internal static Regex kIPRegex = new Regex(@"src\s+(?\d+\.\d+\.\d+\.\d+)"); + internal static readonly Regex kIPRegex = new Regex(@"src\s+(?\d+\.\d+\.\d+\.\d+)"); private AndroidLogcatRuntimeBase m_Runtime; internal string m_IpString; internal string m_PortString; diff --git a/com.unity.mobile.android-logcat/Editor/AndroidLogcatInputs.cs b/com.unity.mobile.android-logcat/Editor/AndroidLogcatInputs.cs index 678f6f84..f5c701ea 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidLogcatInputs.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidLogcatInputs.cs @@ -1,6 +1,7 @@ using System; using UnityEditor; using UnityEngine; +using Unity.Scripting.LifecycleManagement; namespace Unity.Android.Logcat { @@ -9,6 +10,7 @@ namespace Unity.Android.Logcat /// internal class AndroidLogcatInputs { + [NoAutoStaticsCleanup] class KeyResult { internal AndroidKeyCode Key { get; } diff --git a/com.unity.mobile.android-logcat/Editor/AndroidLogcatInternalLog.cs b/com.unity.mobile.android-logcat/Editor/AndroidLogcatInternalLog.cs index 3f38ccd7..5bfb844b 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidLogcatInternalLog.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidLogcatInternalLog.cs @@ -4,9 +4,11 @@ using UnityEngine; using System.Text; using UnityEditor; +using Unity.Scripting.LifecycleManagement; namespace Unity.Android.Logcat { + [NoAutoStaticsCleanup] internal class AndroidLogcatInternalLog : EditorWindow { const int MaxInternalLogMessages = 10000; diff --git a/com.unity.mobile.android-logcat/Editor/AndroidLogcatLayoutViewerWindow.cs b/com.unity.mobile.android-logcat/Editor/AndroidLogcatLayoutViewerWindow.cs index aacd5d1c..594e0e76 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidLogcatLayoutViewerWindow.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidLogcatLayoutViewerWindow.cs @@ -22,9 +22,9 @@ internal static void ShowWindow() class Styles { - public static GUIContent QueryUIHierarchy = new GUIContent("Query UI Layout"); - public static GUIContent SaveUIHierarchy = new GUIContent("Save Layout"); - public static GUIContent SaveScreenshot = new GUIContent("Save Screenshot"); + public static readonly GUIContent QueryUIHierarchy = new GUIContent("Query UI Layout"); + public static readonly GUIContent SaveUIHierarchy = new GUIContent("Save Layout"); + public static readonly GUIContent SaveScreenshot = new GUIContent("Save Screenshot"); } AndroidLogcatRuntimeBase m_Runtime; diff --git a/com.unity.mobile.android-logcat/Editor/AndroidLogcatProjectSettingsProvider.cs b/com.unity.mobile.android-logcat/Editor/AndroidLogcatProjectSettingsProvider.cs index e7ff87bc..a46db8d3 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidLogcatProjectSettingsProvider.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidLogcatProjectSettingsProvider.cs @@ -8,7 +8,7 @@ class AndroidLogcatProjectSettingsProvider : SettingsProvider internal static readonly string kSettingsPath = "Project/Analysis/Android Logcat Settings"; class Styles { - public static GUIContent symbolPaths = new GUIContent("Symbol Paths", "Configure symbol paths, used for resolving stack traces."); + public static readonly GUIContent symbolPaths = new GUIContent("Symbol Paths", "Configure symbol paths, used for resolving stack traces."); } private AndroidLogcatSymbolList m_SymbolList; diff --git a/com.unity.mobile.android-logcat/Editor/AndroidLogcatQueryLayout.cs b/com.unity.mobile.android-logcat/Editor/AndroidLogcatQueryLayout.cs index 474befb5..53526e76 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidLogcatQueryLayout.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidLogcatQueryLayout.cs @@ -9,7 +9,7 @@ namespace Unity.Android.Logcat { internal class AndroidLogcatQueryLayout { - static Regex BoundsRegex = new Regex(@"\[(?\d+),(?\d+)\]\[(?\d+),(?\d+)\]"); + static readonly Regex BoundsRegex = new Regex(@"\[(?\d+),(?\d+)\]\[(?\d+),(?\d+)\]"); const string NodeTag = "node"; const string ClassTag = "class"; diff --git a/com.unity.mobile.android-logcat/Editor/AndroidLogcatScreenCaptureWindow.cs b/com.unity.mobile.android-logcat/Editor/AndroidLogcatScreenCaptureWindow.cs index d011891a..1b072419 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidLogcatScreenCaptureWindow.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidLogcatScreenCaptureWindow.cs @@ -12,16 +12,16 @@ internal class AndroidLogcatScreenCaptureWindow : EditorWindow class Styles { // Note: Info acquired from adb shell screenrecord --help - public static GUIContent TimeLimit = new GUIContent("Time Limit", "Toggle to override time limit (in seconds), by default - time limit is 180 seconds."); - public static GUIContent VideoSize = new GUIContent("Video Size", "Toggle to override video size, by default - device's main display resolution is used."); - public static GUIContent BitRate = new GUIContent("Bit Rate", "Toggle to overide bit rate (in Kbps), the default is 2000Kbps."); - public static GUIContent DisplayId = new GUIContent("Display Id", "Toggle to overide the display to record, the default is primary display, enter 'adb shell dumpsys SurfaceFlinger--display - id' in the terminal for valid display IDs. If empty string is provided primary display will be used."); - public static GUIContent ShowInfo = new GUIContent("Show Info", "Display video information."); - public static GUIContent Open = new GUIContent("Open", "Open captured screenshot or video."); - public static GUIContent SaveAs = new GUIContent("Save As", "Save captured screenshot or video."); - public static GUIContent CaptureScreenshot = new GUIContent("Capture", "Capture screenshot from the android device."); - public static GUIContent CaptureVideo = new GUIContent("Capture", "Record the video from the android device, click Stop afterwards to stop the recording."); - public static GUIContent StopVideo = new GUIContent("Stop", "Stop the recording."); + public static readonly GUIContent TimeLimit = new GUIContent("Time Limit", "Toggle to override time limit (in seconds), by default - time limit is 180 seconds."); + public static readonly GUIContent VideoSize = new GUIContent("Video Size", "Toggle to override video size, by default - device's main display resolution is used."); + public static readonly GUIContent BitRate = new GUIContent("Bit Rate", "Toggle to overide bit rate (in Kbps), the default is 2000Kbps."); + public static readonly GUIContent DisplayId = new GUIContent("Display Id", "Toggle to overide the display to record, the default is primary display, enter 'adb shell dumpsys SurfaceFlinger--display - id' in the terminal for valid display IDs. If empty string is provided primary display will be used."); + public static readonly GUIContent ShowInfo = new GUIContent("Show Info", "Display video information."); + public static readonly GUIContent Open = new GUIContent("Open", "Open captured screenshot or video."); + public static readonly GUIContent SaveAs = new GUIContent("Save As", "Save captured screenshot or video."); + public static readonly GUIContent CaptureScreenshot = new GUIContent("Capture", "Capture screenshot from the android device."); + public static readonly GUIContent CaptureVideo = new GUIContent("Capture", "Record the video from the android device, click Stop afterwards to stop the recording."); + public static readonly GUIContent StopVideo = new GUIContent("Stop", "Stop the recording."); } internal enum Mode { diff --git a/com.unity.mobile.android-logcat/Editor/AndroidLogcatSendTrimMemoryUsage.cs b/com.unity.mobile.android-logcat/Editor/AndroidLogcatSendTrimMemoryUsage.cs index f77d9163..4c864b63 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidLogcatSendTrimMemoryUsage.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidLogcatSendTrimMemoryUsage.cs @@ -1,7 +1,9 @@ using System.Collections.Generic; +using Unity.Scripting.LifecycleManagement; namespace Unity.Android.Logcat { + [NoAutoStaticsCleanup] internal class AndroidLogcatSendTrimMemoryUsage { public string DisplayName { get; } diff --git a/com.unity.mobile.android-logcat/Editor/AndroidLogcatSettings.cs b/com.unity.mobile.android-logcat/Editor/AndroidLogcatSettings.cs index f33ea155..2e10ceb4 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidLogcatSettings.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidLogcatSettings.cs @@ -12,10 +12,10 @@ internal class AndroidLogcatSettings // This will force settings to be reset private const int kVersion = 1; - internal static string kSettingsName = "AndroidLogcatSettings" + kVersion; + internal static readonly string kSettingsName = "AndroidLogcatSettings" + kVersion; // Since querying memory from device is a lengthy operation, here's a cap 500 ms, setting it too low will make memory request to be delayed - internal static int kMinMemoryRequestIntervalMS = 500; + internal const int kMinMemoryRequestIntervalMS = 500; internal static readonly string[] kAddressResolveRegex = { diff --git a/com.unity.mobile.android-logcat/Editor/AndroidLogcatSettingsProvider.cs b/com.unity.mobile.android-logcat/Editor/AndroidLogcatSettingsProvider.cs index a03e6d52..5198d88f 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidLogcatSettingsProvider.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidLogcatSettingsProvider.cs @@ -10,16 +10,16 @@ class AndroidLogcatSettingsProvider : SettingsProvider class Styles { - public static GUIContent maxCachedMessageCount = new GUIContent("Max Cached Messages", "The maximum number of unfiltered messages which are kept in the cache and are used when filtering messages. The number of cached messages affects the performing of filtering. 0 - no limit."); - public static GUIContent maxDisplayedMessageCount = new GUIContent("Max Displayed Messages", "The maximum number of messages which are shown in the list, cannot be bigger than cached message count. 0 - no limit."); - public static GUIContent font = new GUIContent("Font", "Font used for displaying messages"); - public static GUIContent fontSize = new GUIContent("Font Size"); - public static GUIContent stactraceRegex = new GUIContent("Stacktrace Regex", "Configure regex used for resolving function address and library name"); - public static GUIContent symbolExtensions = new GUIContent("Symbol Extensions", "Specify which file extension to append while looking for symbol files."); - - public static GUIContent requestIntervalMS = new GUIContent("Request Interval ms", + public static readonly GUIContent maxCachedMessageCount = new GUIContent("Max Cached Messages", "The maximum number of unfiltered messages which are kept in the cache and are used when filtering messages. The number of cached messages affects the performing of filtering. 0 - no limit."); + public static readonly GUIContent maxDisplayedMessageCount = new GUIContent("Max Displayed Messages", "The maximum number of messages which are shown in the list, cannot be bigger than cached message count. 0 - no limit."); + public static readonly GUIContent font = new GUIContent("Font", "Font used for displaying messages"); + public static readonly GUIContent fontSize = new GUIContent("Font Size"); + public static readonly GUIContent stactraceRegex = new GUIContent("Stacktrace Regex", "Configure regex used for resolving function address and library name"); + public static readonly GUIContent symbolExtensions = new GUIContent("Symbol Extensions", "Specify which file extension to append while looking for symbol files."); + + public static readonly GUIContent requestIntervalMS = new GUIContent("Request Interval ms", $"How often to request memory dump from the device? The minimum value is {AndroidLogcatSettings.kMinMemoryRequestIntervalMS} ms"); - public static GUIContent maxExitedPackageToShow = new GUIContent("Max Exited Packages", "The maximum number of packages in package selection which have exited."); + public static readonly GUIContent maxExitedPackageToShow = new GUIContent("Max Exited Packages", "The maximum number of packages in package selection which have exited."); } private AndroidLogcatRuntimeBase m_Runtime; diff --git a/com.unity.mobile.android-logcat/Editor/AndroidLogcatStyles.cs b/com.unity.mobile.android-logcat/Editor/AndroidLogcatStyles.cs index 5fbb3f1d..4ba6bdff 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidLogcatStyles.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidLogcatStyles.cs @@ -1,5 +1,6 @@ using UnityEngine; using UnityEditor; +using Unity.Scripting.LifecycleManagement; namespace Unity.Android.Logcat { @@ -7,29 +8,30 @@ namespace Unity.Android.Logcat /// UI styles. /// Note: Don't use EditorStyles, since they're not initialized if Editor is ran in batch mode, for ex., tests /// + [NoAutoStaticsCleanup] static class AndroidLogcatStyles { public const int kFontSize = 10; public const int kFixedHeight = kFontSize + 9; - public static GUIStyle toolbar = new GUIStyle("toolbar") { fontSize = kFontSize, fixedHeight = kFixedHeight }; - public static GUIStyle toolbarButton = new GUIStyle("toolbarButton") { fontSize = kFontSize, fixedHeight = kFixedHeight }; - public static GUIStyle toolbarPopup = new GUIStyle("toolbarPopup") { fontSize = kFontSize, fixedHeight = kFixedHeight }; - public static GUIStyle toolbarPopupCenter = new GUIStyle("toolbarPopup") { fontSize = kFontSize, fixedHeight = kFixedHeight, alignment = TextAnchor.MiddleCenter }; - public static GUIStyle toolbarLabelLeft = new GUIStyle("toolbarButton") { fontSize = kFontSize, fixedHeight = kFixedHeight, alignment = TextAnchor.MiddleLeft }; + public static readonly GUIStyle toolbar = new GUIStyle("toolbar") { fontSize = kFontSize, fixedHeight = kFixedHeight }; + public static readonly GUIStyle toolbarButton = new GUIStyle("toolbarButton") { fontSize = kFontSize, fixedHeight = kFixedHeight }; + public static readonly GUIStyle toolbarPopup = new GUIStyle("toolbarPopup") { fontSize = kFontSize, fixedHeight = kFixedHeight }; + public static readonly GUIStyle toolbarPopupCenter = new GUIStyle("toolbarPopup") { fontSize = kFontSize, fixedHeight = kFixedHeight, alignment = TextAnchor.MiddleCenter }; + public static readonly GUIStyle toolbarLabelLeft = new GUIStyle("toolbarButton") { fontSize = kFontSize, fixedHeight = kFixedHeight, alignment = TextAnchor.MiddleLeft }; - public static GUIStyle columnHeader = new GUIStyle("OL TITLE"); + public static readonly GUIStyle columnHeader = new GUIStyle("OL TITLE"); public static int kLogEntryFontSize = 11; public static int kLogEntryFixedHeight = kLogEntryFontSize + 5; - public static GUIStyle background = new GUIStyle("CN EntryBackodd") { fixedHeight = kLogEntryFixedHeight }; - public static GUIStyle backgroundOdd = new GUIStyle("CN EntryBackodd") { fixedHeight = kLogEntryFixedHeight }; - public static GUIStyle backgroundEven = new GUIStyle("CN EntryBackEven") { fixedHeight = kLogEntryFixedHeight }; + public static readonly GUIStyle background = new GUIStyle("CN EntryBackodd") { fixedHeight = kLogEntryFixedHeight }; + public static readonly GUIStyle backgroundOdd = new GUIStyle("CN EntryBackodd") { fixedHeight = kLogEntryFixedHeight }; + public static readonly GUIStyle backgroundEven = new GUIStyle("CN EntryBackEven") { fixedHeight = kLogEntryFixedHeight }; public static readonly Vector2 kSmallIconSize = new Vector2(16, 16); - public static GUIStyle infoSmallStyle = new GUIStyle("CN EntryInfoIconSmall") { fixedHeight = kLogEntryFixedHeight }; - public static GUIStyle warningSmallStyle = new GUIStyle("CN EntryWarnIconSmall") { fixedHeight = kLogEntryFixedHeight }; - public static GUIStyle errorSmallStyle = new GUIStyle("CN EntryErrorIconSmall") { fixedHeight = kLogEntryFixedHeight }; - public static GUIStyle priorityDefaultStyle = new GUIStyle("miniLabel") + public static readonly GUIStyle infoSmallStyle = new GUIStyle("CN EntryInfoIconSmall") { fixedHeight = kLogEntryFixedHeight }; + public static readonly GUIStyle warningSmallStyle = new GUIStyle("CN EntryWarnIconSmall") { fixedHeight = kLogEntryFixedHeight }; + public static readonly GUIStyle errorSmallStyle = new GUIStyle("CN EntryErrorIconSmall") { fixedHeight = kLogEntryFixedHeight }; + public static readonly GUIStyle priorityDefaultStyle = new GUIStyle("miniLabel") { fontSize = kLogEntryFontSize, fixedHeight = kLogEntryFixedHeight, @@ -37,7 +39,7 @@ static class AndroidLogcatStyles font = GetFont() }; - public static GUIStyle[] priorityStyles = new[] + public static readonly GUIStyle[] priorityStyles = new[] { new GUIStyle(priorityDefaultStyle) {}, new GUIStyle(priorityDefaultStyle) {}, @@ -49,22 +51,22 @@ static class AndroidLogcatStyles public const int kStatusBarFontSize = 13; public const int kLStatusBarFixedHeight = kStatusBarFontSize + 5; - public static GUIStyle statusBarBackground = new GUIStyle("AppToolbar") { fixedHeight = kStatusBarFontSize }; - public static GUIStyle statusLabel = new GUIStyle("AppToolbar") { fontSize = kStatusBarFontSize, fixedHeight = kLStatusBarFixedHeight, richText = true }; + public static readonly GUIStyle statusBarBackground = new GUIStyle("AppToolbar") { fixedHeight = kStatusBarFontSize }; + public static readonly GUIStyle statusLabel = new GUIStyle("AppToolbar") { fontSize = kStatusBarFontSize, fixedHeight = kLStatusBarFixedHeight, richText = true }; public const int kTagEntryFontSize = 11; public const int kTagEntryFixedHeight = kTagEntryFontSize + 7; public const int ktagToggleFixedWidth = 10; - public static GUIStyle tagEntryBackground = new GUIStyle("CN EntryBackodd") { fixedHeight = kTagEntryFixedHeight }; - public static GUIStyle tagEntryBackgroundOdd = new GUIStyle("CN EntryBackodd") { fixedHeight = kTagEntryFixedHeight }; - public static GUIStyle tagEntryBackgroundEven = new GUIStyle("CN EntryBackEven") { fixedHeight = kTagEntryFixedHeight }; - public static GUIStyle tagEntryStyle = new GUIStyle("miniLabel") { fontSize = kTagEntryFontSize, fixedHeight = kTagEntryFixedHeight }; - public static GUIStyle tagToggleStyle = new GUIStyle("toggle") { fixedWidth = ktagToggleFixedWidth, fixedHeight = kTagEntryFixedHeight }; - public static GUIStyle tagButtonStyle = new GUIStyle("miniButton") { fixedHeight = kTagEntryFixedHeight }; - public static GUIStyle removeTextStyle = new GUIStyle("miniLabel") { fontSize = 8, fixedHeight = kTagEntryFixedHeight }; + public static readonly GUIStyle tagEntryBackground = new GUIStyle("CN EntryBackodd") { fixedHeight = kTagEntryFixedHeight }; + public static readonly GUIStyle tagEntryBackgroundOdd = new GUIStyle("CN EntryBackodd") { fixedHeight = kTagEntryFixedHeight }; + public static readonly GUIStyle tagEntryBackgroundEven = new GUIStyle("CN EntryBackEven") { fixedHeight = kTagEntryFixedHeight }; + public static readonly GUIStyle tagEntryStyle = new GUIStyle("miniLabel") { fontSize = kTagEntryFontSize, fixedHeight = kTagEntryFixedHeight }; + public static readonly GUIStyle tagToggleStyle = new GUIStyle("toggle") { fixedWidth = ktagToggleFixedWidth, fixedHeight = kTagEntryFixedHeight }; + public static readonly GUIStyle tagButtonStyle = new GUIStyle("miniButton") { fixedHeight = kTagEntryFixedHeight }; + public static readonly GUIStyle removeTextStyle = new GUIStyle("miniLabel") { fontSize = 8, fixedHeight = kTagEntryFixedHeight }; public static readonly GUIStyle kSeriesLabel = "ProfilerPaneSubLabel"; - public static GUIStyle stacktraceStyle = new GUIStyle("textArea") + public static readonly GUIStyle stacktraceStyle = new GUIStyle("textArea") { fontSize = kLogEntryFontSize, font = GetFont(), @@ -72,7 +74,7 @@ static class AndroidLogcatStyles wordWrap = false }; - public static GUIStyle resolvedStacktraceStyle = new GUIStyle("textArea") + public static readonly GUIStyle resolvedStacktraceStyle = new GUIStyle("textArea") { fontSize = kLogEntryFontSize, font = GetFont(), @@ -81,20 +83,20 @@ static class AndroidLogcatStyles wordWrap = false, }; - public static GUIStyle infoStyle = new GUIStyle("label") + public static readonly GUIStyle infoStyle = new GUIStyle("label") { fontSize = kLogEntryFontSize, font = GetFont() }; - public static GUIStyle errorStyle = new GUIStyle("label") + public static readonly GUIStyle errorStyle = new GUIStyle("label") { fontSize = kLogEntryFontSize, font = GetFont(), normal = new GUIStyleState() { textColor = Color.red } }; - public static GUIStyle internalLogStyle = new GUIStyle("CN EntryBackodd") + public static readonly GUIStyle internalLogStyle = new GUIStyle("CN EntryBackodd") { fixedHeight = 13, fontSize = 13, @@ -149,10 +151,10 @@ public static Texture2D LoadIcon(string name) return tex; } - internal static GUIContent kIconToolbarDown = new GUIContent(LoadIcon("DownArrow")); - internal static GUIContent kIconToolbarUp = new GUIContent(LoadIcon("UpArrow")); - internal static GUIContent kIconReset = new GUIContent(LoadIcon("Reset"), "Reset"); - internal static GUIContent[] kIconPlay = new[] { + internal static readonly GUIContent kIconToolbarDown = new GUIContent(LoadIcon("DownArrow")); + internal static readonly GUIContent kIconToolbarUp = new GUIContent(LoadIcon("UpArrow")); + internal static readonly GUIContent kIconReset = new GUIContent(LoadIcon("Reset"), "Reset"); + internal static readonly GUIContent[] kIconPlay = new[] { new GUIContent(LoadIcon("PlayOn")), new GUIContent(LoadIcon("PlayOff")) }; diff --git a/com.unity.mobile.android-logcat/Editor/AndroidLogcatTags.cs b/com.unity.mobile.android-logcat/Editor/AndroidLogcatTags.cs index aa84d548..b324e36b 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidLogcatTags.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidLogcatTags.cs @@ -199,7 +199,7 @@ internal class AndroidLogcatTagListPopup : PopupWindowContent private int m_SelectedTagIndex = -1; private string m_InputTagName = String.Empty; private const string kTagInputTextFieldControlId = "TagInputTextFieldControl"; - private static GUIContent kIconToolbarMinus = EditorGUIUtility.TrIconContent("Toolbar Minus", "Remove from list"); + private static readonly GUIContent kIconToolbarMinus = EditorGUIUtility.TrIconContent("Toolbar Minus", "Remove from list"); public Vector2 m_ScrollPosition = Vector2.zero; diff --git a/com.unity.mobile.android-logcat/Editor/AndroidTools/AndroidBridge.cs b/com.unity.mobile.android-logcat/Editor/AndroidTools/AndroidBridge.cs index f4584e92..e0e69023 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidTools/AndroidBridge.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidTools/AndroidBridge.cs @@ -8,6 +8,7 @@ using Object = System.Object; #if UNITY_6000_5_OR_NEWER using UnityEngine.Assemblies; +using Unity.Scripting.LifecycleManagement; #endif namespace Unity.Android.Logcat @@ -17,6 +18,7 @@ namespace Unity.Android.Logcat /// It solves the problem where if you have logcat package installed, but there's no Android Support installed, you won't get compiler errors /// It also enables to use Logcat package when active platform is not Android /// + [NoAutoStaticsCleanup] class AndroidBridge { enum ExtensionState @@ -64,6 +66,7 @@ private static Assembly AndroidExtensions internal static bool AndroidExtensionsInstalled => AndroidExtensions != null; + [NoAutoStaticsCleanup] internal class ADB { private static Type s_ADBType; @@ -146,6 +149,7 @@ public static ADB GetInstance() } } + [NoAutoStaticsCleanup] internal class AndroidDevice { private static Type s_AndroidDeviceType; @@ -207,6 +211,7 @@ public AndroidDevice(ADB adb, string deviceId) public PropertiesTable Properties => new PropertiesTable(PropertiesPropertyInfo.GetValue(m_AndroidDeviceObject, null)); } + [NoAutoStaticsCleanup] internal class AndroidExternalToolsSettings { private static Type s_AndroidExternalToolsSettingsType; diff --git a/com.unity.mobile.android-logcat/Editor/LifecycleManagementPolyfill.cs b/com.unity.mobile.android-logcat/Editor/LifecycleManagementPolyfill.cs new file mode 100644 index 00000000..e940da45 --- /dev/null +++ b/com.unity.mobile.android-logcat/Editor/LifecycleManagementPolyfill.cs @@ -0,0 +1,14 @@ +#if !UNITY_7000_0_OR_NEWER +using System; + +namespace Unity.Scripting.LifecycleManagement +{ + /// + /// Polyfill for Unity versions without the Lifecycle Management APIs, so [NoAutoStaticsCleanup] can be used unconditionally. + /// + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false)] + internal sealed class NoAutoStaticsCleanupAttribute : Attribute + { + } +} +#endif diff --git a/com.unity.mobile.android-logcat/Editor/LifecycleManagementPolyfill.cs.meta b/com.unity.mobile.android-logcat/Editor/LifecycleManagementPolyfill.cs.meta new file mode 100644 index 00000000..63e4ad76 --- /dev/null +++ b/com.unity.mobile.android-logcat/Editor/LifecycleManagementPolyfill.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4b870082f92240c48ee1af28113f91b5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.mobile.android-logcat/Editor/Tasks/AndroidLogcatDispatcher.cs b/com.unity.mobile.android-logcat/Editor/Tasks/AndroidLogcatDispatcher.cs index 680a928c..b2aa2c3d 100644 --- a/com.unity.mobile.android-logcat/Editor/Tasks/AndroidLogcatDispatcher.cs +++ b/com.unity.mobile.android-logcat/Editor/Tasks/AndroidLogcatDispatcher.cs @@ -2,9 +2,11 @@ using System; using System.Threading; using UnityEngine.Profiling; +using Unity.Scripting.LifecycleManagement; namespace Unity.Android.Logcat { + [NoAutoStaticsCleanup] internal class AndroidLogcatDispatcher { private class IntegrationTask diff --git a/com.unity.mobile.android-logcat/Editor/UI/AndroidLogcatReordableList.cs b/com.unity.mobile.android-logcat/Editor/UI/AndroidLogcatReordableList.cs index ca3ae725..abf05f5f 100644 --- a/com.unity.mobile.android-logcat/Editor/UI/AndroidLogcatReordableList.cs +++ b/com.unity.mobile.android-logcat/Editor/UI/AndroidLogcatReordableList.cs @@ -22,8 +22,8 @@ internal class AndroidLogcatReordableList private int m_SelectedIndex = -1; private string m_InputFieldText = String.Empty; private const string kInputTextFieldControlId = "ReordableListInputTextFieldControl"; - private static GUIContent kIconToolbarMinus = EditorGUIUtility.TrIconContent("Toolbar Minus"); - private static GUIContent kIconToolbarPlus = EditorGUIUtility.TrIconContent("Toolbar Plus"); + private static readonly GUIContent kIconToolbarMinus = EditorGUIUtility.TrIconContent("Toolbar Minus"); + private static readonly GUIContent kIconToolbarPlus = EditorGUIUtility.TrIconContent("Toolbar Plus"); public Vector2 m_ScrollPosition = Vector2.zero; diff --git a/com.unity.mobile.android-logcat/Tests/Editor/AndroidLogcatInitializationTests.cs b/com.unity.mobile.android-logcat/Tests/Editor/AndroidLogcatInitializationTests.cs index 57bc51f5..c7fd43c7 100644 --- a/com.unity.mobile.android-logcat/Tests/Editor/AndroidLogcatInitializationTests.cs +++ b/com.unity.mobile.android-logcat/Tests/Editor/AndroidLogcatInitializationTests.cs @@ -4,8 +4,10 @@ using System.Linq; using Unity.Android.Logcat; using UnityEngine; +using Unity.Scripting.LifecycleManagement; +[NoAutoStaticsCleanup] internal class AndroidLogcatInitializationTests : AndroidLogcatRuntimeTestBase { // We need this for AndroidLogcatTestConsoleWindow diff --git a/com.unity.mobile.android-logcat/Tests/Editor/AndroidLogcatMessageProviderTests.cs b/com.unity.mobile.android-logcat/Tests/Editor/AndroidLogcatMessageProviderTests.cs index 7b5d8a3a..137cf4c1 100644 --- a/com.unity.mobile.android-logcat/Tests/Editor/AndroidLogcatMessageProviderTests.cs +++ b/com.unity.mobile.android-logcat/Tests/Editor/AndroidLogcatMessageProviderTests.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; +using Unity.Scripting.LifecycleManagement; internal class AndroidLogcatFakeMessageProvider : AndroidLogcatMessageProviderBase { @@ -72,10 +73,11 @@ public override bool HasExited } } +[NoAutoStaticsCleanup] internal class AndroidLogcatMessagerProvideTests : AndroidLogcatRuntimeTestBase { - private static IAndroidLogcatDevice kDefaultDevice = new AndroidLogcatFakeDevice90("Fake90"); - private static IAndroidLogcatDevice[] kDevices = new IAndroidLogcatDevice[] { new AndroidLogcatFakeDevice60("Fake60"), kDefaultDevice }; + private static readonly IAndroidLogcatDevice kDefaultDevice = new AndroidLogcatFakeDevice90("Fake90"); + private static readonly IAndroidLogcatDevice[] kDevices = new IAndroidLogcatDevice[] { new AndroidLogcatFakeDevice60("Fake60"), kDefaultDevice }; private static void SupplyFakeMessages(AndroidLogcatFakeMessageProvider provider, IAndroidLogcatDevice device, string[] messages) { From 903550482a44fbb18ce39f1ec77caa2dfea1eb75 Mon Sep 17 00:00:00 2001 From: Tomas Date: Wed, 21 Oct 2026 17:04:11 +0300 Subject: [PATCH 2/6] fix 6.0 failure --- .../Editor/AndroidTools/AndroidBridge.cs | 2 +- .../Editor/LifecycleManagementPolyfill.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.mobile.android-logcat/Editor/AndroidTools/AndroidBridge.cs b/com.unity.mobile.android-logcat/Editor/AndroidTools/AndroidBridge.cs index e0e69023..a9b14088 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidTools/AndroidBridge.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidTools/AndroidBridge.cs @@ -8,8 +8,8 @@ using Object = System.Object; #if UNITY_6000_5_OR_NEWER using UnityEngine.Assemblies; -using Unity.Scripting.LifecycleManagement; #endif +using Unity.Scripting.LifecycleManagement; namespace Unity.Android.Logcat { diff --git a/com.unity.mobile.android-logcat/Editor/LifecycleManagementPolyfill.cs b/com.unity.mobile.android-logcat/Editor/LifecycleManagementPolyfill.cs index e940da45..35d9053a 100644 --- a/com.unity.mobile.android-logcat/Editor/LifecycleManagementPolyfill.cs +++ b/com.unity.mobile.android-logcat/Editor/LifecycleManagementPolyfill.cs @@ -1,4 +1,4 @@ -#if !UNITY_7000_0_OR_NEWER +#if !UNITY_6000_5_OR_NEWER using System; namespace Unity.Scripting.LifecycleManagement From 18f6b79215773894a7df58f8ec9107185017fa03 Mon Sep 17 00:00:00 2001 From: Tomas Date: Wed, 21 Oct 2026 17:31:39 +0300 Subject: [PATCH 3/6] Fix ValidateUsingStatements --- .../Tests/Editor/AndroidLogcatNetTests.cs | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/com.unity.mobile.android-logcat/Tests/Editor/AndroidLogcatNetTests.cs b/com.unity.mobile.android-logcat/Tests/Editor/AndroidLogcatNetTests.cs index d4575e8c..a687169d 100644 --- a/com.unity.mobile.android-logcat/Tests/Editor/AndroidLogcatNetTests.cs +++ b/com.unity.mobile.android-logcat/Tests/Editor/AndroidLogcatNetTests.cs @@ -104,13 +104,20 @@ static bool IsFrameworkReference(string name) => public void ValidateUsingStatements() { var logcatAssembly = GetLogcatAssembly(); - var usingStatementRegex = new Regex(@"using\s+(?[a-zA-Z]+)\.*\S*;"); + var usingStatementRegex = new Regex(@"using\s+(?(?[a-zA-Z]+)\.*\S*);"); - var expectedNamespaces = new[] + // Any namespace under these roots is allowed + var expectedRootNamespaces = new[] { "UnityEditor", "UnityEngine", - "System" + "System", + }; + + // Only these exact namespaces are allowed + var expectedNamespaces = new[] + { + "Unity.Scripting.LifecycleManagement", }; var errors = new StringBuilder(); @@ -120,10 +127,11 @@ public void ValidateUsingStatements() var result = usingStatementRegex.Matches(contents); foreach (Match r in result) { - var namezpace = r.Groups["RootNamespace"].Value; - if (!expectedNamespaces.Contains(namezpace)) + var rootNamespace = r.Groups["RootNamespace"].Value; + var namezpace = r.Groups["Namespace"].Value; + if (!expectedRootNamespaces.Contains(rootNamespace) && !expectedNamespaces.Contains(namezpace)) { - errors.AppendLine($"Unexpected 'using {namezpace}...;' in {file}"); + errors.AppendLine($"Unexpected 'using {namezpace};' in {file}"); } } } From 33050380ca10c89d8f3e08273fe17a09b7ee19d5 Mon Sep 17 00:00:00 2001 From: Tomas Dirvanauskas Date: Thu, 22 Oct 2026 10:58:36 +0300 Subject: [PATCH 4/6] Fix ValidateAssemblyReferences on 6.5 and above --- .../Tests/Editor/AndroidLogcatNetTests.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/com.unity.mobile.android-logcat/Tests/Editor/AndroidLogcatNetTests.cs b/com.unity.mobile.android-logcat/Tests/Editor/AndroidLogcatNetTests.cs index a687169d..b96c4555 100644 --- a/com.unity.mobile.android-logcat/Tests/Editor/AndroidLogcatNetTests.cs +++ b/com.unity.mobile.android-logcat/Tests/Editor/AndroidLogcatNetTests.cs @@ -61,11 +61,16 @@ static bool IsFrameworkReference(string name) => }); }; #endif +#if UNITY_6000_5_OR_NEWER + expectedReferences.AddRange(new[] + { + "Unity.Scripting" + }); +#endif #if UNITY_6000_7_OR_NEWER expectedReferences.AddRange(new[] { - "Unity.Scripting", "UnityEngine.ScriptingModule", "UnityEngine.UICommonModule", }); From ab462eaa997eed36cf1975a97c5a2f7e4adfb1ad Mon Sep 17 00:00:00 2001 From: Tomas Dirvanauskas Date: Thu, 22 Oct 2026 10:59:07 +0300 Subject: [PATCH 5/6] Don't test 6.5, since it's not supported, switch to 6.6 --- .yamato/config.metadata | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamato/config.metadata b/.yamato/config.metadata index d2cd2192..ee553bdf 100644 --- a/.yamato/config.metadata +++ b/.yamato/config.metadata @@ -1,5 +1,5 @@ test_editors: - version: 6000.0 - version: 6000.3 - - version: 6000.5 + - version: 6000.6 - version: trunk \ No newline at end of file From a52647740c24d923f91fbee3d088fa010e4108a2 Mon Sep 17 00:00:00 2001 From: Tomas Dirvanauskas Date: Thu, 22 Oct 2026 11:29:34 +0300 Subject: [PATCH 6/6] Add NoAutoStaticsCleanup to types with mutable statics merged from master Fixes UAL0013 on Unity 7 for AndroidLogcatCaptureList.Styles, AndroidLogcatImageViewer.Styles, AndroidLogcatLiveStream and AndroidLogcatUtilities. Co-Authored-By: Claude Opus 5.5 --- .../Editor/AndroidLogcatCaptureList.cs | 2 ++ .../Editor/AndroidLogcatImageViewer.cs | 2 ++ .../Editor/AndroidLogcatLiveStream.cs | 2 ++ .../Editor/AndroidLogcatUtilities.cs | 2 ++ 4 files changed, 8 insertions(+) diff --git a/com.unity.mobile.android-logcat/Editor/AndroidLogcatCaptureList.cs b/com.unity.mobile.android-logcat/Editor/AndroidLogcatCaptureList.cs index 6d6c695c..42bb0f9b 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidLogcatCaptureList.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidLogcatCaptureList.cs @@ -3,6 +3,7 @@ using System.IO; using Unity.Profiling; using UnityEditor; +using Unity.Scripting.LifecycleManagement; using UnityEngine; namespace Unity.Android.Logcat @@ -20,6 +21,7 @@ namespace Unity.Android.Logcat /// internal class AndroidLogcatCaptureList { + [NoAutoStaticsCleanup] static class Styles { internal static readonly GUIContent Live = new GUIContent("Live", diff --git a/com.unity.mobile.android-logcat/Editor/AndroidLogcatImageViewer.cs b/com.unity.mobile.android-logcat/Editor/AndroidLogcatImageViewer.cs index b70c5192..4337097f 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidLogcatImageViewer.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidLogcatImageViewer.cs @@ -1,5 +1,6 @@ using System; using UnityEditor; +using Unity.Scripting.LifecycleManagement; using UnityEngine; namespace Unity.Android.Logcat @@ -13,6 +14,7 @@ namespace Unity.Android.Logcat /// internal class AndroidLogcatImageViewer { + [NoAutoStaticsCleanup] static class Styles { static readonly string kModifier = diff --git a/com.unity.mobile.android-logcat/Editor/AndroidLogcatLiveStream.cs b/com.unity.mobile.android-logcat/Editor/AndroidLogcatLiveStream.cs index 184cc273..dd21b8e5 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidLogcatLiveStream.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidLogcatLiveStream.cs @@ -10,6 +10,7 @@ using System.Threading; using Unity.Profiling; using UnityEditor; +using Unity.Scripting.LifecycleManagement; using UnityEngine; namespace Unity.Android.Logcat @@ -34,6 +35,7 @@ namespace Unity.Android.Logcat /// because Texture2D can only be touched there. /// /// + [NoAutoStaticsCleanup] internal class AndroidLogcatLiveStream { internal enum Result diff --git a/com.unity.mobile.android-logcat/Editor/AndroidLogcatUtilities.cs b/com.unity.mobile.android-logcat/Editor/AndroidLogcatUtilities.cs index 628ba496..58334d8c 100644 --- a/com.unity.mobile.android-logcat/Editor/AndroidLogcatUtilities.cs +++ b/com.unity.mobile.android-logcat/Editor/AndroidLogcatUtilities.cs @@ -5,10 +5,12 @@ using System.Collections.Generic; using System.Linq; using UnityEditor; +using Unity.Scripting.LifecycleManagement; using UnityEngine.UIElements; namespace Unity.Android.Logcat { + [NoAutoStaticsCleanup] internal static class AndroidLogcatUtilities { internal static readonly string kAbiArm64 = "arm64-v8a";