- Home /
cannot build player while editor is importing assets or compiling scripts
The same problem in Unity 2019.3 Answer by ryjoe1312 has nothing in common with it
I deleted my answer sorry, I saw the building player and compiling script
I got the solution that unity tell you there is some scripts has errors you should delete it and delete the GI cash.. that's helped me
Answer by Pbasnal17 · Mar 26, 2020 at 02:34 PM
Found a solution- https://forum.unity.com/threads/i-cant-build-my-game.803667/
I had few scripts with "using Editor;" in them which were not part of an Editor assembly definition. After refactoring and moving editor scripts to editor assembly definition and monobehaviour scripts to normal assembly definition, it worked. @geekm
Answer by lvskiprof · Sep 01, 2020 at 10:40 PM
I don't have a Using line for it, but I do use a method from it. It allows my exit method to handle being in the Unity editor. So I leave the code there, but disable it with a #if:
public void ExitGame()
{
if (Application.isPlaying & !Application.isEditor)
Application.Quit(); // We may return from this, but the program will terminate at the end of the frame
#if false
else
UnityEditor.EditorApplication.isPlaying = false; // Handle being in the editor, but set #if to true to use it
#endif
} // ExitGame()
Answer by sincerelysleepy · May 01, 2020 at 09:38 AM
Did you create a custom UnityEditor script? If you did, you need to move it to another project that sits outside of your main project. For example, I had a PopupScriptableEditor.cs file in my main project "Assembly-CSharp". I moved that script into my "Assembly-CSharp-Editor" project. The issue is that the "Player" or your main project is trying to build but there is an "Editor" script, that is also trying to be compiled at the same time and it's not allowed.
Heloo how to move script to another project??
Answer by masmear · Jun 26, 2020 at 01:52 PM
I got the solution that unity tell you there is some scripts has errors you should delete it and delete the GI cash.. that's helped me
Answer by Qman2015 · Jul 29, 2020 at 11:29 PM
alt text
unity cannot build player while editor is importing assets or compiling scripts
Using blot Using UnityEngine
If I delete this, it doesn't work. How do I fix it?
Your answer
![](https://koobas.hobune.stream/wayback/20220612222917im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
error CS0012 0 Answers
I can't build a game for android 2 Answers
[Unity 2017.3.0f3] Cannot open my build it Crashes (with crash Raport) 1 Answer
Not pushing content to device 0 Answers
Build & Run won't finish 0 Answers