Unity Engine script assemblies not accessible in my package

I have this project; a package I’m developing that’s extending Unity’s Layout Element component. However, when I build I get errors like below


Packages\UnityLayoutElementExtended\Editor\Editors\LayoutElementExtendedEditor.cs(2,19): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
 
Packages\UnityLayoutElementExtended\Editor\Editors\LayoutElementExtendedEditor.cs(8,48): error CS0246: The type or namespace name 'LayoutElementEditor' could not be found (are you missing a using directive or an assembly reference?)
 
Packages\UnityLayoutElementExtended\Editor\PropertyDrawers\LayoutElementExtendedValuePropertyDrawer.cs(7,61): error CS0246: The type or namespace name 'PropertyDrawer' could not be found (are you missing a using directive or an assembly reference?)

I have script assemblies for both sections of my code (Scripts and Editor). I think I’ve set their references correctly

The errors above are like I need to set UnityEngine and UnityEditor themselves as references but they do not appear as an option to do so. I’m kind of stumped as to what the problem is.

I have a feeling I’m missing something really simple or this is a Unity bug. Anyone else have similar issues?

I’m on Windows Unity 2020.

Ah, so the issue was that my editor Assembly Reference needed to exclude all platforms except the editor. Yay for simple solution!