Frequent hang on Android build?

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).

I just had a similar build error (“Packaging assets…”) on beta 5.6.0b3. I updated the Android SDK and afterwards it worked!

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.

i had the exactly same problem and after removing new uber post proccessing lib problem solved.

Well if the shadercompiler process is using CPU - it’s doing something :slight_smile:

What if you leave it for some time?

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.

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.

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…

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.

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)