Hello I have this problem where I try to build, even a nearly empty scene and the editor stuck in the build.
Googling I read some similar problem talking about shader compiling broken for some reason, I also have some shader compiler process going on at high cpu % in background so that may be it.
But the project has lot of stuff and many assets and it would be really hard to identify which one, also I dont get why Unity try to pack the assets to build an empty scene…
Is there a way to make the build verbose or similar so to know at which point building the project slows down?
That was not the case, I mean it happens very often cause for some reason unity sometimes returns the baking to auto even if I disable it but in my case I had it off, also easy to spot cause you see the bottom right blue bar of lighting.
Unchecking “Auto” does not help, also I tried to export the whole project and import to a new empty project without success. Delete “library” folder does not fix it, too.
Hope someone here knows the answer for this issue.
It is very likely some incompatible shader, I have a bunch of assets with shaders, once I removed them all it started work again, even though I can’t be 100% sure since I removed a lot of scripts and models and stuff, my best guess is some old shader though
Do you use “VolumetricFog&Mist” ? This caused the issue in my case! After deleting this asset from my project, everything is working again. I have contacted the developer just now.
I am having the same issue. It took at least 8 hours for just one build. I think there are some incompatible assets. I am using version 5.5.1p1. I haven’t tested on other version.
Hi there,
“Uber-shaders” use shader keywords which are responsible of producing many shader variants during the first Build (after that they get cached). They do to improve performance by reusing the same render Pass to combine many effects or features in optimized way so only the required code for the configured feature set is executed in the GPU.
Usually the asset documentation states which shader keywords can be removed (by editing the shader file) so they don’t make Unity compile unnecesary variants.
Volumetric Fog & Mist goes a step further and includes a Build Options section in the inspector that allows you to disable many shader features/keywords with a click so you don’t have to edit the shader files by yourself. So this should not be an issue if you make proper use of the asset.
Other shaders on the Asset Store that use keywords and also the new Unity PostProcessing stack will produce same issues (lengthy compilations and lot of unused variants included in your build) unless you manually edit the shader source to comment out the unwanted keywords.
Shader Control is a useful package on the Asset Store that quickly locates all shader keywords in your project, list them by shader and allows you to disable any keyword with a single click.
In any case it’s recommended to read the documentation of the purchased packages which probably covers this issue.
AFAIK Unity 5.6 brings some improvements and optimisations during the shader compilation stage so it should help as well when it comes out.
Confirmed!
After adding Unity PostProcessing BETA, building was ‘stuck’ at packaging resources. I didn’t bother waiting and seeing when it will unlock, though. Just deleted the newly added files and we’re good to go again.
Also, confirmed that any standalone, xcode project and linux builds (we can safely assume others would ‘fail’ too) didn’t complete.
I upgraded my project to 5.6.0b8. After I was unable to get system to “settle down” (auto bake delays), I disabled Baked GI and Realtime GI and did a manual bake. (Large project, so took 2 hours). Then I tried a build and found that Thrawn75 above is correct, the first build takes very long (mine took almost 2 hours) but then it gets better…ie probably the variants issue.) It appears to hang during the build, but it does complete eventually. Note: I work on a linux ubuntu machine with 16gb Ram and was able to create linux, mac and windows builds successfully. Also, for the record I used Gaia & Aquas in this project.
Update: Certain areas of the underwater Caustic in Aquas did not bake at all, so not sure what the problem is yet…
Next, I re-enabled Baked GI and Realtime GI (you must decide if your project needs it), and did a new manual bake, then build.
I went to Window → Lighting → Settings and scrolled down and hit Generate Lightmap at the bottom on the first tab of the lighting window. It creates a folder for the scene. I had been messing around with Lighting earlier and doing this fixed it.
I had also been using Post Processing for the first time and have determined that was not causing the issue.
I’ve been having this problem and apparently Unity doesn’t catch when it runs out of memory, if you have ample RAM you can open task manager, right click the Unity process and select “go to details” then right click that and set priority > high to give it more memory to work with. This works for me sometimes but not 100%
In my case, It was bloom effect which froze unity, also in the build settings I unchecked the auto graphics API and removed Vulkan and open GLES.2 it does take some amount of time to build after adding the Effects to build.