You should not use UnityEditor in a build. You can use
#if UNITY_EDITOR #endif
to surround code that should only be used in the editor (a.k.a. usage of the UnityEditor namespace)