HoloLens throwing Shader.Find exception

Hi all,

I have built a simple application which uses an OBJ runtime loader from the asset store. It requires that the “Standard (Specular setup)” shader is added to ‘Always included shaders’. This is the only ‘off normal’ thing I did in the project.

The project is built for HoloLens (and therefore enables XR and WMR). The project built and deployed correctly, but when I try to load the model (which works in editor), an exception is thrown in the following IL2CPP function:

// UnityEngine.Shader UnityEngine.Shader::Find(System.String)
extern "C" IL2CPP_METHOD_ATTR Shader_tE2731FF351B74AB4186897484FB01E000C1160CA * Shader_Find_m755654AA68D1C663A3E20A10E00CDC10F96C962B (String_t* ___name0, const RuntimeMethod* method)
{
    typedef Shader_tE2731FF351B74AB4186897484FB01E000C1160CA * (*Shader_Find_m755654AA68D1C663A3E20A10E00CDC10F96C962B_ftn) (String_t*);
    static Shader_Find_m755654AA68D1C663A3E20A10E00CDC10F96C962B_ftn _il2cpp_icall_func;
    if (!_il2cpp_icall_func)
    _il2cpp_icall_func = (Shader_Find_m755654AA68D1C663A3E20A10E00CDC10F96C962B_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Shader::Find(System.String)");
    Shader_tE2731FF351B74AB4186897484FB01E000C1160CA * retVal = _il2cpp_icall_func(___name0);
    return retVal;
}

Any ideas would be appreciated.

Thanks!

Put an object in one of your scenes that actually references the missing shader, see if it suddenly works: just because you added it to “always included shaders” doesn’t mean something else down the long build chain doesn’t remove it.

If it suddenly works, then yeah, despite you saying keep it, it was getting stripped. If it doesn’t work, check spelling on the shader name.

@Kurt-Dekker thanks for the tip! I did exactly that and the application crashes on startup!

@jc_crash were you able to solve this ?I am stuck at the same line and I a also trying to use the same shader and importer!