MissingMethodException: Method not found: 'UnityEngine.GameObject.GetComponentsInParent'.

Starting a new thread as the other one about this issues has a inappropriate title. I’m getting the following error whenever I Extend the Unity GUI system. It was working fine that all of a sudden it just stopped. Reverting does not help only copying in original files.

Also I did NOT modify anything in the Graphics. Only added an event. Very strange. The error spams for all objects.

MissingMethodException: Method not found: ‘UnityEngine.GameObject.GetComponentsInParent’.
UnityEngine.UI.Graphic.get_canvas ()
UnityEngine.UI.Graphic.OnDisable ()
UnityEngine.UI.MaskableGraphic.OnDisable ()

Ive confirmed this problem on both Windows 7 and Mac OSX 10.9.
Here’s what I did:

  • Cloned the bitbucket repo for Unity UI
  • Made NO Changes to the code.
  • On Windows: built in Visual Studio
  • On Mac, built in MonoDevelop
  • All builds work fine - no errors.

Copied .dlls to:
UnityExtensions/Unity/GUISystem/4.6.0
(UnityEngine.UI.dll, Editor/UnityEditor.UI.dll)

Same error as @hoesterey on both Windows 7 and Mac OSX.

Either we’re missing something in the deployment notes or this thing is broken.
(I also read through Sander Horman’s blog)

Anyone else having this problem?

1 Like

I’ve spent another few hours on this. No luck. Is there a way to upload the project as a bug? Not sure the UI code/Extension code will upload.

You need to try update to unity 4.6.1. 4.6.0 do not have these methods…

also, https://bitbucket.org/Unity-Technologies/ui/downloads check “Tags” and download 4.6.0p1 zips

1886452--121370--upload_2014-12-15_11-59-34.png

No luck,
Few questions.
After upgrading to 4.6.1f1 I should be downloading the 4.6.1f1 tag correct?
Is the tag just a known working build or do I want to do something specific with it?

What I did
Upgraded to Unity 4.6.1
Downloaded both sets of tags tried them both.
Tried both building the “Tag” download and copying in the output as well as copying the none .cs files into my build and building that.

In all cases I get the same errors and the GUI disappears.

I tested this and it is working. Please make sure the version of unity you are using matches the tag of the UI you have. Can you list the mercurial commands you are using?

I got it working! Thanks for the info peoples.
After upgrading to 4.6.1f1 my build didn’t overwrite the files in output. Deleting the output folder and rebuilding after upgrading fixed the problem.

Thanks!
-Matt

This worked for me!

I downloaded 4.6.1f1 release, and then pulled tag 4.6.1f1, built using MonoDevelop on Windows 7.
Now working for me. I was able to make changes and build UnityEngine.UI.dll and verify that my changes for InputField.cs worked in my game.

(I did find it curious that this works even though the GUID in ivy.xml does not match the GUID in the AssemblyInfo.cs file for this dll. Perhaps it’s ignored?)

@ - I made editor changes to my fork to support multi-line ending as follow:
Ctrl-Home (beginning of input field)
Home (beginning of line)
Ctrl-End (end of input field),
End (end of line)
Also, Append() from clipboard was not allowing newlines or tabs. I changed that so that I can cut and paste. These changes are to support my editing of lua code in an InputField.
Scroll - added event handler for OnScroll to handles scrolling with the mouse wheel inside of a multi-line input field.

1 Like

Old topic but I ran into an issue similar to these recently wherein a C# DLL that I created was throwing the MissingMethodException error when invoking a method inside the DLL. The method was clearly defined and functional (Other methods within the same and other DLLs could call it internally) but Unity just wouldn’t see it.

If using Visual Studio (This could very well be an issue unique to it), the solution was to clean the solutions and remove any project references pointing to the offending DLL and then re-add them. Rebuild the entire solution and re-import the newly created DLLs into Unity.

I add this in the hopes that if someone else out there happens to have this issue as well, they’ll find this thread and read through it.

Cheers!

1 Like

This would be an issue with any dlls being built. When you build them you are targeting a specific assembly version of UnityEngine, UnityEditor, UnityEngine.UI, UnityEngine.UI.Standalone, and UnityEngine.UI. If you go ahead and update your version of Unity the dlls will change but you are referencing the old ones.

This is one disadvantage of building your libraries into DLLs. With a bit of setup you can set up a build system in MSBuild to do this for you.

Cheers,

1 Like