Has anyone ever dealt with this error before.

I’m Trying to finish this project and I have this really annoying error preventing me from proceeding.
I really could use some help. How did I get rid of it?

Here is the error message:

Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/GraphicRebuildTracker.cs(24,32): error CS0117: ‘CanvasRenderer’ does not contain a definition for ‘onRequestRebuild’

Sounds like perhaps you are either missing a package or a package is corrupted in some way because onRequestRebuild definitely exists.

Note that this identifier is ONLY available in the editor, so any uses of it should be guarded with #if UNITY_EDITOR

Extra unwanted packages in new projects (collab, testing, rider and other junk):

About the fastest way I have found to make a project and avoid all this noise is to create the project, then as soon as you see the files appear, FORCE-STOP (hard-kill) Unity (with the Activity Manager or Task Manager), then go hand-edit the Packages/manifest.json file as outlined in the above post, then reopen Unity.

Sometimes the package system gets borked from all this unnecessary churn and requires the package cache to be cleared:

Thank you. I’ll check it out. You are always one of the few who reply to my questions. seriously thank you.

1 Like

The above error is very strange since it is coming from the com.unity.ugui package, which is at version 1.0.0 and has blessedly not been through any other version changes… and AFAIK the target identifier it is going for is ALSO in that package, and the package is read-only!

So… yeah, seems like something is borkled in the package mangler. You could try REMOVING the com.unity.ugui package and re-adding it??

are you talking about the objects in this image? These happen to be the folder/script causing the issue. It won’t allow me to delete them, if so, is it even possible to delete it?

Everything you just wrote, that’s why I say “it’s very strange,” why you should remove, then re-add that package, or perhaps all packages.

That’s What I did. And it cleared the error. Now I’m dealing with another:
Assets/Assets/Scripts/ThirdPersonController.cs(114,16): error CS0246: The type or namespace name ‘Image’ could not be found (are you missing a using directive or an assembly reference?)

I sent the project to a team member to work on a specific piece of the project. Is it possible that we are using different versions of Unity that I keep getting these errors

Different versions of Unity are not interchangeable. You may always upgrade to a higher version but files written by higher version are not at all guaranteed to work in a lower version.

Additionally the UnityEngine.UI namespace (aka the com.unity.ugui package) used to be included within Unity until some point (I forget when) when they moved it to be a package, which means it must be added to Packages/manifest.json or else it will not be present.