Shader not loading on addressable

I’m moving my addressable objects to a separate project and have hit a snag with loading custom shaders.

I load a custom ScriptableObject which has a Material on it, which in turn has a custom shader assigned. This worked fine when the SO was addressable on the main project, but it’s not loading the shader when the addressables are built in another project. The SO and Mat load fine and show in the hierarchy, but the shader goes to the error shader:


Both projects have the shader set to always load, here are their Graphics Settings side-by-side:

I saw a similar question here but I don’t use AssetBundle.UnloadAll or anything like that. And building this SO/Mat/Shader into a bundle in the game project loads it fine.

Both the game and the assets projects are Unity 2020.3.25.f1 and use Addressables 1.18.19

Help appreciated!

OK I somehow managed to fix it, but the fix doesn’t make sense to me, so still keen to figure out what is going on. Here are the steps I took and now it’s loading both this shader and another shader correctly:

  1. Make the shader itself addressable and put it in a separate addressables group
  2. Rebuild addressables in the asset project
  3. Rebuild addressables in the game project
  4. Shader now loaded fine
  5. Remove shader from addressables
  6. Rebuild addressables in the asset project
  7. Shader still loads fine
  8. Add another material that requires a different custom shader in the asset project, rebuild addressables
  9. Both shaders now load fine

So this makes no sense to me. Questions still in my head:

  1. Adding the shader explicitly as an addressable item didn’t seem to do anything as it still loaded after I rebuilt addressables - correct?
  2. If it was rebuilding addressables on the game project that resolved it, then why did the second shader load fine without that rebuild? Also addressables on the game project isn’t set to any of the paths the assets project builds to so they shouldn’t have anything to do with one another anyway?
  3. Why did the second shader load fine without being included in the always load shaders section of the Graphics Settings?

So it works, it’s “fixed” but I don’t actually understand which part of that fixed it and why, any comments appreciated to try to figure out so that people have a deterministic fix for this type of issue.

I have the same problem loading a remote catalog. It worked fine, did a new build and uploaded the files (yes, including the hash file) and then the game project complains about:
RemoteProviderException : Invalid path in AssetBundleProvider:
Tried your technique, but no luck.

Here is my fix.

My app is used at various museums.
I have multiple catalogs (one for each museum)
I load content for that catalog programaitically.

Ran into an issue where some shaders were consistently missing.
Odd thing was, behaviour changed depending on what profile was set as default in Addressables.

Tried making shaders part of a resource material. Tried forcing inclusion in settings. No lukc.

What I did is place small cubes in one scene from each catalogue that used the missing shaders.
Brute force now everyone is dependent on those shaders and it just works.

Not sure if that is a bug or a feature.