Hi,
I am using addressables with Unity CCD to download my app assets.
I have 2 prefabs. One has multiple models inside of it and one has references to other prefabs in its script. So in theory it should make all the referenced prefabs + models + textures addressables.
But after loading the content from the CDN, I get pink materials.
I deleted the prefabs from the scene after using them as addressables.
I included all the shaders I am using in “Project Settings => Graphics => Always include” shaders.
One possible reason is that the graphical api of the shader was unsupported. If you were testing the Android’s asset bundle on Editor, the shader would be pink. You need to use “Vulkan” for the Editor. It’s a universal graphical api.
Or try to force the renderer to reload the shader with go.GetComponent<Renderer>().material.shader=Shader.Find("Universal Render Pipeline/Lit");
However, that didnt work for me when I did an Android build. My scene is actually empty except for a script to spawn in the addressable assets, so I just added just a dummy cube into the scene and it worked preventing the shader from appearing pink. I have no idea what is going on.
Hi are you trying to load Android bundles in the Editor? If so, then pink shaders are expected in this case. Bundles are platform dependent. I would only expect Android bundles to load correctly on an Android device.
Yea I am loading android bundles on the android device.
I wanted to submit a bug report but it is not consistent. With a fresh project it is fine but happened once or twice, with my current project happens all the time
Omg yes you are right, I totally missed this point.
One last thing question, so setting it to keep all shaders works fine, but if I try to add the URP/Lit shader to the list of always includes shaders the build time really explodes into hours… is this correct?