Running into a strange error with Shader Graph 12.1.6 and URP 12.1.6 in Unity 2021.2.16f1

So I’ve been trying to download my projects to my new laptop and anytime I make a new 3D URP based project I run into the error below. It seems to be related to Shadergraph and URP specifically, if I remove these packages from the project everything works fine. If it makes any difference, Both versions of Unity I have tried this with are located in a custom applications folder instead of their default install location. I wouldn’t expect this to be the reason for the error since everything else with the project seems to work fine.

The Error:
Library\PackageCache\com.unity.shadergraph@12.1.6\Editor\Generation\Targets\BuiltIn\Editor\ShaderGUI\MaterialAssemblyReference\RawRenderQueue.cs(12,24): error CS1061: ‘Material’ does not contain a definition for ‘rawRenderQueue’ and no accessible extension method ‘rawRenderQueue’ accepting a first argument of type ‘Material’ could be found (are you missing a using directive or an assembly reference?)

This is the Script being referenced:
using System.Runtime.CompilerServices;
using UnityEngine;

[assembly: InternalsVisibleTo(“Unity.ShaderGraph.Editor”)]

namespace UnityEditor.Rendering.BuiltIn.ShaderGraph
{
internal static class MaterialAccess
{
internal static int ReadMaterialRawRenderQueue(Material mat)
{
return mat.rawRenderQueue;
}
}
}

I also get this error on opening the project:
Asset Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/Editor/ShaderGUI/MaterialAssemblyReference/MaterialAssemblyReference.asmref has no meta file, but it’s in an immutable folder. The asset will be ignored.

Do I need to delete or change something to make this work? Does anyone know why this is happening?

Edit: Some additional info, on my other computer I’m using 12.1.4 and I’ve never seen these issues, is there way I can just use that version? Also this computer is currently running Windows 11 if that makes a difference

1 Like

Just adding a message to bump this up since it was getting a bit buried

Edit: Was able to solve this problem, will write a post detailing how tomorrow

The way I fixed this was by uninstalling and reinstalling Unity Hub and my existing Unity Engine installs. I then installed the latest version of Unity (2021.2.17f1) and grabbed my project from Plastic and the issue seems to be fixed. Not entirely sure if it was because of how the folder structure was setup (previously there were two separate Unity folders present) or if grabbing 2021.2.17 fixed it but things seem to be working now! Going to mark the thread as resolved.

The unity is not responding

Same thing happens to me. Unity 2021.3.2f1

See my post here:
https://forum.unity.com/threads/cant-start-the-3d-hdrp-core-template-in-2021-lts.1266842/#post-8100653

Same problem when creating a new project URP 3D template with unity 2021.3.1f1. And also the same problem when adding the URP package to an existing project.

1 Like

I am having the same issue. I am using unity 2021.3.4f1
Reimporting the project doesn’t solve my issue :(.

I am having the same issue. When loading a new project based on the URP 3D template there are 100+ errors relating to missing meta files in immutable folders.

Same issue. i find that a file is missing.
unzip this and drag it into “\MyProject\Library\PackageCache\com.unity.shadergraph@12.1.7\Editor\Generation\Targets\BuiltIn\Editor\ShaderGUI\MaterialAssemblyReference” then back to unity to recompile the scripts.
if this still doesn’t work, just do it again.

8452430–1121381–MaterialAssemblyReference.asmref.zip (349 Bytes)

6 Likes

i love you, no homo

3 Likes

Still getting this error expect im using 12.1.7 versions of HDRP/URP and shader graph. Currently it is impossible to use any shadergraph and or HDRP/URP. even loading the basic HDRP/URP template gives a do you want to run in safe mode due to errors, message.
Using unity 2021.3.12f1

I have reinstalled unity multiple times, reset package manger, reimported assets. No luck at all.

Hey, I am missing the CS script that matches that meta file can u please send it please, you should be a like saver

For anyone who is having issues here is a dlownload to a working shader graph 12.1.8 install from 2021.3.16f1 just replace the existing one from Library/PackageCache

Hey guys,

Since it looks like no definitive answer has been delivered here, here is my solution.

I’m convinced the issue has to do with residues of Unity from previous installations. I had Unity installed a while ago on another hard drive and since I removed it from my computer, I could not delete the file from the Apps and Features menu.

Here is my solution for Windows 10 Pro :

1 - Enable seeing hidden files on your computer
2 - Save your projects on another drive/cloud then delete them from your computer
3 - Completely uninstall Unity and Unity Hub
4 - Go to C:\Users*YourName*\AppData\Local and delete the folders from Unity and Unity Hub (don’t worry, if you delete those, they will be recreated at the reinstallation, you just need a clean install)
5 - If you have the same specific issue as me, follow this tutorial

BE CAREFUL WHILE DELETING FILES FROM REGISTRY AND ALWAYS CREATE A BACKUP REGISTRY
6 - Completely turn off your computer to save the changes (careful, because some computer just turn into heavy sleep mode, you need to pull the plug to be sure it works)
7 - Reinstall Unity Hub and the latest LTS Unity version, it should work properly

Spent an afternoon of my day off to fix this issue, don’t hesitate to update this post if the solution does not work, since we seem to have no help from Unity for this.

Peace,

OnePete7

1 Like

Hey Man the correct code is
using System.Runtime.CompilerServices;
using UnityEngine;

[assembly: InternalsVisibleTo(“Unity.ShaderGraph.Editor”)]

namespace UnityEditor.Rendering.BuiltIn.ShaderGraph
{
internal static class MaterialAccess
{
internal static int ReadMaterialRawRenderQueue(Material mat)
{
return mat.renderQueue;
}
}
}

You are a hero <3

Thank you Breaks-!

THANK YOU!!

This answer just saved me. I can’t believe a Long Term Support version from two years ago still has this bug…