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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Frequent hang on Android build?

Discussion in '5.6 Beta' started by PhobicGunner, Dec 23, 2016.

  1. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Been trying out b2 with my new Android and I've gotta say, this is a fantastic update.
    That said, I keep having an issue where sometimes, while building for Android, it just seems to get stuck on "packaging assets" and sits there forever (and, I've noticed, a ton of shader compilers sitting in the background). If it helps, I've had "Vulkan" set as the top graphics API (unused right now, waiting for an OS update for my phone before I can use Vulkan), haven't yet tried with just ES3 and no Vulkan.

    Has anyone else been experiencing this?

    EDIT: Welp, just tried a build with no Vulkan and it appears to have done it again. Just hangs on "Packaging assets - 8ce0a6f4c8cae334d8a5617f02b6769". There are 6 instances of UnityShaderCompiler.exe running in the background right now, each taking between 10-15% of my CPU. It's always the same string after "Packaging assets" that it hangs on as well, no matter which project I'm building (I've tried several).
     
    Last edited: Dec 23, 2016
  2. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    228
    I just had a similar build error ("Packaging assets...") on beta 5.6.0b3. I updated the Android SDK and afterwards it worked!
     
  3. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    OK thanks for the tip, I'll go ahead and try that.
    EDIT: Sadly, no difference. Most of the time it works just fine, but it still intermittently hangs on that step. Usually, this happens when I mess around with graphics or quality settings. Often begins working again once I force quit Unity and reopen it, but I have accidentally trashed one scene doing that.

    EDIT2: Have also noticed that CPU usage seems to be an indicator of when it will and won't work. When it does work, even if it stalls at that step for a while, it uses a meager 3-5% of my CPU. But other times, it pegs 100% of one of my cores non-stop and never finishes.
     
    Last edited: Dec 25, 2016
  4. tayfuntoprak

    tayfuntoprak

    Joined:
    Jun 15, 2016
    Posts:
    1
    i had the exactly same problem and after removing new uber post proccessing lib problem solved.
     
  5. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,165
    Well if the shadercompiler process is using CPU - it's doing something :)

    What if you leave it for some time?
     
  6. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    One of those times, I actually did just that. Left it. Took about 15-20 minutes, max CPU the entire time, to make a build, and this is a nearly empty project mind you.
     
  7. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,876
    It seems you have some shader with too many keywords which causes Unity to compile too many variants. Check out the documentation for the image effects you may have in your project as they usually carry many keywords that could be removed.
     
  8. trevorchico

    trevorchico

    Joined:
    Feb 1, 2016
    Posts:
    7
    AhHH! I can't figure this out either... Updated unity from 5.4.1 to 5.5.1 and android sdk, and tried with empty scene/project... deleted projectSettings... messed with most of the build settings...

    How do I change the shader settings and "removing new uber post proccessing lib"

    For what I'm doing I do have alot fo plugins... Oculus, OpenCV, and Beautify... but it was working before without this issue...
     
  9. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,876
    One thing to check: select a camera with beautify attached and take a look at Beautify's inspector. You will see a Build Options button there. Click it and disable all effects you don't use. Save and try again.
    Also check other Image Effects, like Unity PostProcessing Stack. You may want to edit its shader and comment out some shader keywords.
     
  10. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,999
    i got this reply for my bug report last year (#861097, with 5.5.0p1)
    had same issue, shader compiler took 100% cpu on builds..
    (had unity post processing stack in the project)