cannot build player while editor is importing assets or compiling scripts

Hey!

I’m pretty new to Unity and i recently started to make a game. Well then, of course, when the game was done, i wanted to build it. When i tried to do that, it gave me the error that tells me: “cannot build player while editor is importing assets or compiling scripts”.

So, i looked at the error log and then it says there: “error building player because scripts had compiler errors”.

So does that mean that i have to fix those errors to continue or? (Check the screenshot for the error log)

For this “cannot build player etc.” error, i’ve tried to remove the “UnityEditor”, what caused the error to many other people, but i feel like i can’t find it anywhere. Perhaps it’s not in my scripts?

What should i do? Any idea?

6931960--813934--error1.JPG

Those look like package errors.

First, back up your project COMPLETELY (or else use source code).

Now go into the package manager (Window → PackageManager).

First try updating things that are complaining error-wise, then try removing them and re-adding them.

1 Like

Hey!

Thanks for the help, but i got it to work. I just had to downgrade my Unity version and then update it back.

Hi there, this is the only source I found on internet for this problem.

I tried both solutions (updating all package/re-import and downgrading/updating unity) but it seems Unity is not letting me create a release of my game.

I’m starting to get desperate , so far I tried 2 platforms Windows, Mac, Linux and the Universal Windows Platform but every time I try to “Build” I get this annoying pop up of “Cannot build player while editor is importing assets or compiling scripts” I don’t really understand what is the problem, I’m not importing anything and I don’t have any errors logged

i forgot to mentioned i also tried to reinstall VS with its proper workloads but so far I haven’t solve it, any ideas why this pop up from hell is stopping me to create the release? thank you so much in advance!

1 Like

I don’t think you still need help, but I’ll write anyway, run the build, and errors will appear in the console, start from them when solving the problem

3 Likes

Had same issue, actually reading the errors I saw that there was something refering to using UnityEditor.Experimental.GraphView;
I think this was added by intellisense when I typed something in and I didnt realize it added the using in the beginning of the file. Just removing this line solved the issue.

5 Likes

i need to build an apk on my pc and it needs to compile scripts while building and that stops the build, any fix?

So guys, this problem could be anything from a syntax error in code or a line of code that doesn’t work. Like MrW82 said, mine was a problem with using UnityEditor.SceneManagement. It was simply that the Intellisense auto completed it the wrong way. using UnityEditor.SceneManagement wasn’t what I needed, so it didn’t cooperate with the rest of my code. I changed it to using UnityEngine.SceneManagement.

2 Likes

I have the same problem but this time its diffrent…
i dont have unity.editor in any script
there are 0 errors in the console
the game is functional on unity remote and on pc
thats it so sm1 pls help

I don’t understand can people be more specific plz?

Don’t know if it still relevant, but for me the problem was that some of my scripts were using non-existent libraries that my editor auto added to my project.
I deleted them, and everything built properly.

1 Like