error CS0234: The type or namespace name `IActiveBuildTargetChanged

After many failed attempts, re-imports etc. I’m forced to ask if anyone is familiar with this Cloud Build error. this is since updated to Unity 2017.1

7358: [Unity] -----CompilerOutput:-stdout–exitcode: 1–compilationhadfailure: True–outfile: Temp/Assembly-CSharp-firstpass.dll
7359: [Unity] Compilation failed: 1 error(s), 0 warnings
7360: [Unity] Assets/Standard Assets/CrossPlatformInput/Scripts/MobileControlRig.cs(13,29): error CS0234: The type or namespace name IActiveBuildTargetChanged' does not exist in the namespace UnityEditor.Build’. Are you missing an assembly reference?
7361: [Unity] - Finished compile Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll
7362: [Unity] Assets/Standard Assets/CrossPlatformInput/Scripts/MobileControlRig.cs(13,29): error CS0234: The type or namespace name IActiveBuildTargetChanged' does not exist in the namespace UnityEditor.Build’. Are you missing an assembly reference?

It will build successfully, but when I run on iPad it just freezes out

Update: Ok, I created a completely new, empty Unity project and then imported the Standard Assets package and then ran it through Cloudbuild, and I’m still getting this error. Does this mean it’s a bug? These things do tend to happen just after a new Unity release. The culprits seem to be either IActiveBuildTargetChanged or mobilecontrolrig.cs

Well i just had this error and was very annoyed trying to figure it out… I was trying to add a FPScontroller and it had the compiling error that you had. I just went to where that error was and deleted the line at the top where it said
#if UNITY_EDITOR
, UnityEditor.Build.IActiveBuildTargetChanged
#endif

After this another script had the same msg and i deleted that too

@Nedgoom

Make sure all your related code (including the IActiveBuildTargetChanged reference) is inside a UNITY_EDITOR directive :

#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.Build;

public class YourClass : IActiveBuildTargetChanged
{
    //Your code
}
#endif