Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

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

Discussion in 'UGUI & TextMesh Pro' started by hoesterey, Dec 13, 2014.

  1. hoesterey

    hoesterey

    Joined:
    Mar 19, 2010
    Posts:
    659
    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 ()
     
  2. jkraptor

    jkraptor

    Joined:
    Sep 28, 2013
    Posts:
    24
    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?
     
    hoesterey likes this.
  3. hoesterey

    hoesterey

    Joined:
    Mar 19, 2010
    Posts:
    659
    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.
     
  4. Ma Liangjian

    Ma Liangjian

    Joined:
    Dec 26, 2013
    Posts:
    1
  5. hoesterey

    hoesterey

    Joined:
    Mar 19, 2010
    Posts:
    659
    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.
     
  6. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,181
    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?
     
  7. hoesterey

    hoesterey

    Joined:
    Mar 19, 2010
    Posts:
    659
    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
     
  8. jkraptor

    jkraptor

    Joined:
    Sep 28, 2013
    Posts:
    24
    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?)

    @TimC - 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.
     
    Last edited: Dec 15, 2014
    Tim-C likes this.
  9. Clu

    Clu

    Joined:
    May 25, 2014
    Posts:
    1
    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!
     
    Senshi likes this.
  10. BMayne

    BMayne

    Joined:
    Aug 4, 2014
    Posts:
    186
    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,
     
    Clu likes this.