Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

cannot build player while editor is importing assets or compiling scripts

Discussion in 'Editor & General Support' started by runkkaaja, Mar 13, 2021.

  1. runkkaaja

    runkkaaja

    Joined:
    Mar 13, 2021
    Posts:
    2
    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?
     

    Attached Files:

  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,713
    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.
     
    aimandhuman likes this.
  3. runkkaaja

    runkkaaja

    Joined:
    Mar 13, 2021
    Posts:
    2
    Hey!

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

    Mizhael

    Joined:
    Jul 15, 2015
    Posts:
    5
    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!
     
  5. LIANIT

    LIANIT

    Joined:
    Sep 4, 2020
    Posts:
    1
    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
     
    jangomoose likes this.
  6. MrW82

    MrW82

    Joined:
    Feb 2, 2022
    Posts:
    4
    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.
     
    Jamisco likes this.
  7. Doodlebug512012

    Doodlebug512012

    Joined:
    May 26, 2023
    Posts:
    1
    i need to build an apk on my pc and it needs to compile scripts while building and that stops the build, any fix?
     
  8. Chorgard

    Chorgard

    Joined:
    Aug 17, 2023
    Posts:
    1
    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
    .