Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Has anyone ever dealt with this error before.

Discussion in 'Editor & General Support' started by Rsrc10, Mar 31, 2023.

  1. Rsrc10

    Rsrc10

    Joined:
    Sep 2, 2020
    Posts:
    12
    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'
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,263
    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):

    https://forum.unity.com/threads/temp-unityengine-testrunner-dll-error.1133938/#post-7287748

    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:

    https://stackoverflow.com/questions/53145919/unity3d-package-cache-errors/69779122
     
  3. Rsrc10

    Rsrc10

    Joined:
    Sep 2, 2020
    Posts:
    12
    Thank you. I'll check it out. You are always one of the few who reply to my questions. seriously thank you.
     
    Kurt-Dekker likes this.
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,263
    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??
     
  5. Rsrc10

    Rsrc10

    Joined:
    Sep 2, 2020
    Posts:
    12
    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?
     

    Attached Files:

  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,263
    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.
     
  7. Rsrc10

    Rsrc10

    Joined:
    Sep 2, 2020
    Posts:
    12
    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
     
  8. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,263
    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.