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: Spoiler: Open me 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 Spoiler: Open me 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
Usually this is because you're using a .NET 4.0 DLL. Unity only supports .NET up to 3.5. So you could use an older version of JSON.NET, or check out this guy's asset: http://forum.unity3d.com/threads/released-json-net-for-unity-3-5-with-aot-support.200336/ which I have not used but seems popular. Personally I use fastJson ( https://fastjson.codeplex.com/ ) which is free, and comes with a .NET 3.5 project version that you can compile to work in Unity.
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.
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.