On build only, FindObjectsOfTypeAll does not exist in the current context"

I am removing textures from memory (loaded from Resources) using Resources.FindObjectsOfTypeAll(). My script works fine in the editor

using UnityEngine;
using UnityEditor;
using System.Collections.Generic;

public class AppController : MonoBehaviour {
    public static void RemoveAllTexturesFromMemory(){
        // find all loaded textures
        Texture2D[] ts = FindObjectsOfTypeAll(typeof(Texture2D)) as Texture2D[];
        Debug.Log("Number of all loaded Textures " + ts.Length);
        // remove based on name here ...
    }
}

…but when I attempt to build I get the following error:

error CS0103: The name FindObjectsOfTypeAll does not exist in the current context

What could be causing this issue?

I found my error thanks to a friend who pointed out that I should be using Resources.FindObjectsOfTypeAll()