[Fixed] Memory Profiler 0.2.3-preview.2 doesn't compile in Unity 2019.4.0f1

Library/PackageCache/com.unity.memoryprofiler@0.2.3-preview.2/Editor/MemoryProfilerWindow.cs(1031,17): error CS0103: The name ‘EditoUtilityCompatibilityHelper’ does not exist in the current context

The contents of EditorUtilityCompatibilityHelper.cs are compiled-out because of:

#if !UNITY_2019_4_OR_NEWER
using System;
using UnityEngine.Internal;

namespace UnityEditor
{
    internal static class EditoUtilityCompatibilityHelper
    {

so this code doesn’t compile:

        void TakeCapture()
        {
            if (EditorApplication.isCompiling)
            {
                Debug.LogError("Unable to snapshot while compilation is ongoing");
                return;
            }

            if (EditoUtilityCompatibilityHelper.DisplayDialog(Content.HeapWarningWindowTitle, Content.HeapWarningWindowContent, Content.HeapWarningWindowOK, EditoUtilityCompatibilityHelper.DialogOptOutDecisionType.ForThisMachine, MemoryProfilerSettings.HeapWarningWindowOptOutKey))
            {
                this.StartCoroutine(DelayedSnapshotRoutine());
            }
            EditorGUIUtility.ExitGUI();
        }
6 Likes

Thanks for alerting us to this issue. It has since also been reported as a bug. A fix is on it’s way.

This is fixed in 0.2.4-preview.1.

3 Likes

I am on Unity 2020.2.1 and having the same issue. Should I upgrade to higher Unity version?

Hi @Zaskar7777 ,
Which Version of the Package are you using and have you tried updating the package via the Package Manager?

If that doesn’t help, are you getting the exact same error message / code location for the compilation error?