Search Unity

Weird .dll issues

Discussion in 'Scripting' started by EBR, Oct 29, 2014.

  1. EBR

    EBR

    Joined:
    Jan 27, 2013
    Posts:
    117
    I have Yosemite and am using unity 4.6b21 & 4.6b20 and am getting strange bugs. I am trying to pull information off of google sheets and I think the errors are from Newtonsoft.Json.dll but I don't have experience with this sort of thing so if someone could help me that would be great :)
    When I view something in the inspector I get this in the console:
    ReflectionTypeLoadException: The classes in the module cannot be loaded.
    System.Reflection.Assembly.GetTypes () (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/Assembly.cs:371)
    UnityEditor.Events.InterceptedEventsPreview.GetEventsInfo (UnityEngine.GameObject gameObject) (at /Applications/buildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystemeditor/UI/InterceptedEventsPreview.cs:164)
    UnityEditor.Events.InterceptedEventsPreview.Initialize (UnityEngine.Object[] targets) (at /Applications/buildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystemeditor/UI/InterceptedEventsPreview.cs:62)
    UnityEditor.InspectorWindow.GetPreviewsForType (UnityEditor.Editor editor)
    UnityEditor.InspectorWindow.CreatePreviewables ()
    UnityEditor.InspectorWindow.OnGUI ()
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

    and

    ArgumentException: Getting control 0's position in a group with only 0 controls when doing Repaint
    Aborting
    UnityEngine.GUILayoutGroup.GetNext ()
    UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options, System.Type LayoutType)
    UnityEditor.EditorGUILayout.BeginVerticalScrollView (Vector2 scrollPosition, Boolean alwaysShowVertical, UnityEngine.GUIStyle verticalScrollbar, UnityEngine.GUIStyle background, UnityEngine.GUILayoutOption[] options)
    UnityEditor.EditorGUILayout.BeginVerticalScrollView (Vector2 scrollPosition, UnityEngine.GUILayoutOption[] options)
    UnityEditor.InspectorWindow.OnGUI ()
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    View attachment 117059
    As well as this when I try to build my project
    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.AssemblyTypeInfoGenerator.GetFields (Mono.Cecil.TypeDefinition type, Boolean isGenericInstance, System.Collections.Generic.Dictionary`2 genericInstanceTypeMap)
    UnityEditor.AssemblyTypeInfoGenerator.AddType (Mono.Cecil.TypeReference typeRef, System.Collections.Generic.Dictionary`2 genericInstanceTypeMap)
    UnityEditor.AssemblyTypeInfoGenerator.AddBaseType (Mono.Cecil.TypeReference typeRef, System.Collections.Generic.Dictionary`2 genericInstanceTypeMap)
    UnityEditor.AssemblyTypeInfoGenerator.AddType (Mono.Cecil.TypeReference typeRef, System.Collections.Generic.Dictionary`2 genericInstanceTypeMap)
    UnityEditor.AssemblyTypeInfoGenerator.AddNestedTypes (Mono.Cecil.TypeDefinition type, System.Collections.Generic.Dictionary`2 genericInstanceTypeMap)
    UnityEditor.AssemblyTypeInfoGenerator.AddType (Mono.Cecil.TypeReference typeRef, System.Collections.Generic.Dictionary`2 genericInstanceTypeMap)
    UnityEditor.AssemblyTypeInfoGenerator.GatherClassInfo ()
    UnityEditor.AssemblyHelper.ExtractAssemblyTypeInfo (System.String assemblyPathName)
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

    And

    Internal compiler error. See the console log for more information. output was:
    Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
    at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
    at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0
    at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in <filename unknown>:0
    at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in <filename unknown>:0
    at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in <filename unknown>:0
    at Mono.CSharp.Driver.LoadReferences () [0x00000] in <filename unknown>:0
    at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0
    at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0

    And

    Error building Player because scripts had compiler errors
    View attachment 117060
     
  2. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
  3. EBR

    EBR

    Joined:
    Jan 27, 2013
    Posts:
    117
    Thanks for the quick response, I tried to use a .dll compiled in .NET 3.5 and it didn't work but one that was compiled in .NET 2.0 does so thank that was the fix.
     
    makeshiftwings likes this.
  4. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    You might be able to get the 3.5 working by going to Unity Project Settings -> Player Settings and changing the .NET Compatibility from ".NET 2.0 Subset" to ".NET 2.0", but if the 2.0 dll is working fine for you then there's probably no need.
     
    EBR likes this.
  5. EBR

    EBR

    Joined:
    Jan 27, 2013
    Posts:
    117
    I'll stick with .NET 2.0, because I cant be bothered to find .NET 3.5 :p
    Thanks for the help.