Search Unity

Build stuck on packaging assets - resources.assets

Discussion in 'Editor & General Support' started by dworm, Jan 9, 2017.

  1. dworm

    dworm

    Joined:
    Jun 17, 2015
    Posts:
    74
    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?

    Anyway any help would be appraciated.
     
  2. superaldo666

    superaldo666

    Joined:
    Aug 30, 2013
    Posts:
    17
    Try to uncheck the "Auto" checkbox from Window > Lighting
     
    ezoran17 and ben_page like this.
  3. dworm

    dworm

    Joined:
    Jun 17, 2015
    Posts:
    74
    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 :D but in my case I had it off, also easy to spot cause you see the bottom right blue bar of lighting.
     
  4. MS80

    MS80

    Joined:
    Mar 7, 2014
    Posts:
    346
    I have exactly the same problem!?! :(

    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.
     

    Attached Files:

  5. dworm

    dworm

    Joined:
    Jun 17, 2015
    Posts:
    74
    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
     
  6. MS80

    MS80

    Joined:
    Mar 7, 2014
    Posts:
    346
    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.
     
    Mandark likes this.
  7. dworm

    dworm

    Joined:
    Jun 17, 2015
    Posts:
    74
    Nope, but thank you anyway.
     
  8. yoonack

    yoonack

    Joined:
    Apr 29, 2016
    Posts:
    16
    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.
     
  9. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,904
    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.
     
    Last edited: Feb 12, 2017
    AGregori and TheSuperGroup like this.
  10. pavlito

    pavlito

    Joined:
    Nov 27, 2007
    Posts:
    136
    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.

    Hope this helps.
     
    steven_scottyd likes this.
  11. Mafutta

    Mafutta

    Joined:
    Sep 30, 2014
    Posts:
    45
    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.
     
    Last edited: Mar 2, 2017
  12. paranoidxbox

    paranoidxbox

    Joined:
    Jul 15, 2016
    Posts:
    2
    The error may also appear if your hard drive is full...
     
    Shredsauce likes this.
  13. MarsOnFire

    MarsOnFire

    Joined:
    Jul 16, 2016
    Posts:
    6
    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.
     
    ben_page likes this.
  14. MarshCZA

    MarshCZA

    Joined:
    Apr 5, 2016
    Posts:
    6
    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%
     
    RAVIKANTH1885 and developer4030 like this.
  15. watercolorheartdev

    watercolorheartdev

    Joined:
    Sep 25, 2017
    Posts:
    17
    I'm having this problem in Unity 2017.1 too! But the fixes suggested here didn't work...
     
  16. dhami-nitin

    dhami-nitin

    Joined:
    Jun 5, 2016
    Posts:
    8
    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.
     
    ben_page likes this.
  17. ben_page

    ben_page

    Joined:
    Feb 6, 2016
    Posts:
    5
    #2, #13, and #16 saved the day for me. Using Unity 2017.2.0f3.
     
    martinbuezas likes this.
  18. fahadshafique

    fahadshafique

    Joined:
    Aug 25, 2015
    Posts:
    3
    in my case it solved by removing "uber shaders" which comes with unity "post processing stack" asset :)
     
  19. Vaxxed

    Vaxxed

    Joined:
    Aug 26, 2017
    Posts:
    1
    In my case it helped when in Edit/Project Settings/Graphics in always included shaders i included the shaders i used in my build
     
    Pharaoh_ and Carsten65536 like this.
  20. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
  21. gtzpower

    gtzpower

    Joined:
    Jan 23, 2011
    Posts:
    318
    Just ran into this. I had to delete the "Postprocessing" folder that was imported when I was playing around with the post processing stack. Didn't end up wanting to use any of it anyway.
     
    GameJob2017 and monoganog like this.
  22. ShardulMane

    ShardulMane

    Joined:
    Aug 28, 2017
    Posts:
    1
    My build also freezes on packaging sharedassets0.assets..
    Previous builds were all going fine.. Then suddenly the build started to freeze on sharedassets0..
    I didnt make any changes in the project , so what may be the problem ???
    Please help me ...
    Thank you ..
     
  23. genaray

    genaray

    Joined:
    Feb 8, 2017
    Posts:
    191
    Got the same problem as ShardulMane... im only using Standard shader in my project and when using it i cant build my app.
     
  24. leemin

    leemin

    Joined:
    Oct 29, 2014
    Posts:
    3
    just remove the buildin standard shader from always include. It will build fine.
     
    birk likes this.
  25. Melcx

    Melcx

    Joined:
    Mar 22, 2016
    Posts:
    43
    You can also exclude manually some compile branches from PostProcessing/Resources/Shaders/Uber.shader :
    For example, if you don't need Chromatic Aberration effect, replace :
    Code (CSharp):
    1. #pragma multi_compile __ CHROMATIC_ABERRATION
    by
    Code (CSharp):
    1. #define CHROMATIC_ABERRATION 0
    I think that UNITY_COLORSPACE_GAMMA should not be disabled.
     
    GameJob2017 and JotaRata like this.
  26. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    Building for mac the first time it took around 15 minutes when a build usually only takes me 4-5. But it pushed through it fine.
     
  27. Jacky_Chang

    Jacky_Chang

    Joined:
    Feb 28, 2017
    Posts:
    1
    All of the above does not have the answer I want !!!!!!~~~
     
    MishaMa likes this.
  28. rafalfaro18

    rafalfaro18

    Joined:
    Feb 24, 2018
    Posts:
    1
    In my case unchecking on the Terrain 3D object "LightMap static" option fixed it.
     
  29. rlalancette

    rlalancette

    Joined:
    Sep 20, 2014
    Posts:
    18
    Same problem here.
    Trying solutions posted on this forum to see how far I can get.

    Update: Fixed by removing PostProcessing free asset from unity
     
    Last edited: Mar 30, 2018
    GameJob2017 likes this.
  30. JotaRata

    JotaRata

    Joined:
    Dec 8, 2014
    Posts:
    61
    I think that if you only need Bloom effect, you can simply disable the ones that you don't need, This answer did work for me my compile time is now 4 - 5 mins without deleting the entire post processing folder. Thanks @Melcx !
     
  31. CrazyZombieKiller

    CrazyZombieKiller

    Joined:
    Jun 8, 2015
    Posts:
    6
    This works for me although I don't really understand why. I noticed my compile worked first thing in the morning, but never afterward. So I checked out the performance metrics in the task manager. When the pc boots up the core memory usage was definitely the smallest. As you run more apps it goes up. So every time I want to do a Android compile I shut down the computer, boot it back up, and immediately compile my game. The core memory usage goes down from over 6 mb to just under 4. It always works. Maybe the Android compile needs more memory but doesn't want to tell you that or crash when it goes into an infinite loop. Sometimes when the memory usage is low, under 4 mb it still doesn't work unless I shut down the computer and compile right away when I start up the computer. I tried changing the shaders but that didn't fix the problem. It may help the game run better. It's always good to learn. I learned about the mobile shaders. They look almost the same but should help performance when running. This technique always works for me. I would be hopelessly stuck without this technique. Hope this helps.
     
  32. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    As someone pointed, in my case it was the lack of space in C:, despite the project was in G:
     
  33. BikaYoBadi

    BikaYoBadi

    Joined:
    Jan 1, 2016
    Posts:
    50
    If you have this problem when you imported postprocessing effects, try this solution but only add post processing effects shaders. This solved the problem for me.
     
  34. RAVIKANTH1885

    RAVIKANTH1885

    Joined:
    Oct 11, 2016
    Posts:
    1
    Thanks MarshCZA ,setting set priority > high to Unity process in Taskmanager solved my problem.can anyone help me in suggesting nice article on APK build process
     
  35. playerinteractive

    playerinteractive

    Joined:
    Jul 28, 2018
    Posts:
    3
    in my case
    Post Processing Stack
    cause this problem when i remove this build working fine .
     
    GameJob2017 likes this.
  36. AlaX-x

    AlaX-x

    Joined:
    Jul 25, 2017
    Posts:
    12
    and me too :) thanks for all your answers
     
  37. Thev2Andy

    Thev2Andy

    Joined:
    Aug 6, 2019
    Posts:
    3

    Thanks, that is my problem lol.