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
Answer by Nedgoom · Aug 20, 2017 at 05:21 PM
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
Answer by Jkfanzy1 · Oct 03, 2017 at 09:25 PM
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
Answer by lavos2300 · Jan 04 at 11:27 AM
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
Your answer
Follow this Question
Related Questions
Game crashes during IAPs only on iPad (Unity 2018.4.19) 0 Answers
iOS App crashes with stack from UnityCleanup() 0 Answers
Changing pixel color to transparent on iPad air 2 not working? 0 Answers
[iOS] iPad when pressed home button and open app again it display black screen 0 Answers
Help! Null exception and "filename currently not available on il2cpp Line: -1", 1 Answer