I keep getting this error when trying to build and run to my Android device for testing. I’ve searched heavily on this error for a whole week and most of the solutions were to get rid of scripts that were using “using UnityEditor”, but I don’t have any scripts that use UnityEditor. The only scripts that use UnityEditor are the GooglePlayServicesPlugin scripts.
I don’t really know how to debug it too since it doesn’t highlight the files when I click on the error. I really need help on this because it’s been holding me back for one whole week.
Section of log where the error appears and build gets canceled:
DisplayProgressNotification: Build Failed
Error building Player: 2 errors
(Filename: Line: -1)
Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.011370 seconds (Nothing changed)
Unloading 54 Unused Serialized files (Serialized files now loaded: 0)
System memory in use before: 74.0 MB.
System memory in use after: 74.2 MB.
Unloading 49 unused Assets to reduce memory usage. Loaded Objects now: 3363.
Total: 10.974792 ms (FindLiveObjects: 0.299456 ms CreateObjectMapping: 0.052543 ms MarkObjects: 10.576966 ms DeleteObjects: 0.044641 ms)
Ignoring 'Assets/Plugins/UnityPurchasing/Bin/Apple/live/Apple.dll' because we're compiling for Editor:Editor
Ignoring 'Assets/Plugins/UnityPurchasing/Bin/Editor.dll' because we're compiling for Editor:Editor
Ignoring 'Assets/Plugins/UnityPurchasing/Bin/Facebook/live/FacebookStore.dll' because we're compiling for Editor:Editor
Ignoring 'Assets/Plugins/UnityPurchasing/Bin/Security/Security.dll' because we're compiling for Editor:Editor
Ignoring 'Assets/Plugins/UnityPurchasing/Bin/Tizen/live/Tizen.dll' because we're compiling for Editor:Editor
Ignoring 'C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/Standalone/UnityEngine.UI.dll' because we're compiling for Editor:Editor
Ignoring 'C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/Networking/Standalone/UnityEngine.Networking.dll' because we're compiling for Editor:Editor
Ignoring 'C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/UnityHoloLens/Runtime/UnityEngine.HoloLens.dll' because we're compiling for Editor:Editor
Ignoring 'C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/UnityVR/Runtime/UnityEngine.VR.dll' because we're compiling for Editor:Editor
Ignoring 'Library/FacebookSDK/Facebook.Unity.Arcade.dll' because we're compiling for Editor:Editor
Ignoring 'Library/FacebookSDK/Facebook.Unity.dll' because we're compiling for Editor:Editor
Ignoring 'Library/FacebookSDK/FacebookNamedPipeClient.dll' because we're compiling for Editor:Editor
Ignoring 'Assets/Plugins/UnityPurchasing/Bin/Apple/live/Apple.dll' because we're compiling for Editor:Editor
Ignoring 'Assets/Plugins/UnityPurchasing/Bin/Editor.dll' because we're compiling for Editor:Editor
Ignoring 'Assets/Plugins/UnityPurchasing/Bin/Facebook/live/FacebookStore.dll' because we're compiling for Editor:Editor
Ignoring 'Assets/Plugins/UnityPurchasing/Bin/Security/Security.dll' because we're compiling for Editor:Editor
Ignoring 'Assets/Plugins/UnityPurchasing/Bin/Tizen/live/Tizen.dll' because we're compiling for Editor:Editor
Ignoring 'C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/Standalone/UnityEngine.UI.dll' because we're compiling for Editor:Editor
Ignoring 'C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/Networking/Standalone/UnityEngine.Networking.dll' because we're compiling for Editor:Editor
Ignoring 'C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/UnityHoloLens/Runtime/UnityEngine.HoloLens.dll' because we're compiling for Editor:Editor
Ignoring 'C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/UnityVR/Runtime/UnityEngine.VR.dll' because we're compiling for Editor:Editor
Ignoring 'Library/FacebookSDK/Facebook.Unity.Arcade.dll' because we're compiling for Editor:Editor
Ignoring 'Library/FacebookSDK/Facebook.Unity.dll' because we're compiling for Editor:Editor
Ignoring 'Library/FacebookSDK/FacebookNamedPipeClient.dll' because we're compiling for Editor:Editor
- starting compile Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll, for buildtarget 13
*** Cancelled 'Build.Player.AndroidPlayer' in 23 seconds (22818 ms)
It should be highlighting which scripts are using UnityEditor once the build fails, you can also try building for Windows and Mac to see if it spits out the errors properly there. I don’t see why it would make a difference but worth a try.
Anyway as for your problem, do a text search for your entire project and look for “uding UnityEditor”. If its in Any scripts that are not in an ‘Editor’ folder then that script will fail to compile. If you need to keep that code in there then you can wrap it in:
#if(UNITY_EDITOR)
using UnityEditor; #endif
But you also need to apply that to anywhere that needed that reference, such as EditorGUILayout.Floatfield etc.
I searched the whole project, and the only scripts that are using UnityEditor are the Google Play Services Scripts and UnityIAPPurchasing scripts; those scripts are in their respective Editor folders too. This really sucks.
I updated my post with the section of the log where the error occurs.
Did you ever fix this? I am having the same problem, the log doesnt even tell you what the errors are or, where they are, I have been trying to fix things that get mentioned but the error number never goes down. How the hell do you work out whats causing it not to build??
I actually did fix this problem, but I don’t actually remember what I did. All I remember was that it was a frustrating to get it working again.
I think the first thing I tried was reverting back to an older, stable version of Unity. Then I think that didn’t work for me, so I removed all my plugins and reimported them. Not entirely sure if that’s what I did to make it solve my problem, but I don’t have that problem anymore.
Also, make sure you back up before you try anything that I just mentioned.
After upgrading from 5.5 to 5.6.5f1 I SIMPLE WAS NOT ABLE TO BUILD MY PROJECT FOR ANDROID ANYMORE. I received the exact same error only difference was a higher Number lol 10 Build Errors with No Details.
With total 20+ scenes it took me forever to narrow down the issue.
The problem was texture compressions for terrains textures and a few sprites.
It drove me literally nuts. Apparently Unity 5.6.x does not support ECB4, DXT1 and 16 bit for Android anymore and maybe a bunch others too.
I guess for the future the most save way to compress stuff is doing it by yourself without using Unity built in compression
For me, the problem was resolved when I switched the platform in build settings to something else (like PC) and then switched it back to iOS like I wanted. I think it was missing some assembling libraries. Hope this helps someone!
I know this old thread, but I faced this problem today when I tried to compile the server build.
The problem was because I leave the USB-C connected to my phone. when I unplugged it, the compilation is successfully completed.
theres another good thread about this. Basically it usually boils down to something being included from unityEditor, make sure all of them lines are surrounded by #if UNITY_EDITOR using UnityEditor; etc
For me, I kept getting the error while trying to build and run. After deleting my build folder and recreating it, then making a new build and then selecting build and run, it got rid of the errors.
well i had this problem while building my multiplayer game that uses photon, i tried too many things but none of them worked. i lastly tried to restart unity and my computer. i fixed that way. Hope this helps