Compile Shader Variants Taking a Very Long Time

I have read many posts about this, but still don’t have a good answer or solution.

I created a new project with the Unity Hub for 2019.3.9f1. I chose the default 3D project that includes the Universal Render Pipeline. It is my first time dealing with the URP.

I removed the default objects in the default scene and started building my game. I am not using any of the shaders other than the default URP Lit shader. I am using some materials that came with the sample scene, but most of my materials were auto created when I dropped a texture onto a model from my images folder.

So this has been working fine until I switched my project to Android (it was on iOS) and did my first build to my Android test device. This is an Oculus Quest. So I also added the new XR Integration and set it up.

When I did my first build to the Quest the build spent many HOURS compiling the shaders. What the heck is that all about. It was compiling all these shaders that I don’t even use.

So I read some posts about it and never did get clear on what was going on. I ended up removing the URP and its package. This removed the shader compiling for many of the shaders, but there are still many Standard shaders that still have to get compiled.

Some of the things I have tried are making a precompiled shader asset. This didn’t help. I also tried removing shaders from the required shader list. That didn’t help. No matter what post I follow to try to make this faster it still takes forever compiling the shader variants.

I am running this on a 2018 MacBook Pro with the i9 processor, so this isn’t a slow computer.

Can someone please tell me why this is happening and how to fix it?

+1 @Hotshot10101 - I’m experiencing the exact same issue on 2019.3.12f1. Did you figure out something else since then?

I regret ever installing the URP, my builds used to be buttery smooth but even since I removed its package it takes ages… Notably on the Hidden/TerrainEngine files, I feel hopeless because I felt like I tried everything.