Reflection Errors

28 views
Skip to first unread message

uncle...@gmail.com

unread,
Dec 15, 2017, 8:52:14 AM12/15/17
to Developer Support
Hi!
Unity3d 5.6.4
Having errors

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 /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/Assembly.cs:371
at Candlelight.ReflectionX.get_AllTypes () [0x0002c] in E:\work2\zoo-polis\zoo-polis\Assets\Plugins\Candlelight\Library\Editor\Utilities\ReflectionX.cs:68
at Candlelight.UnityFeatureDefineSymbols+<UnityFeatureDefineSymbols>c__AnonStorey0.<>m__1 (System.String fullName) [0x0000d] in E:\work2\zoo-polis\zoo-polis\Assets\Plugins\Candlelight\Library\Editor\Utilities\UnityFeatureDefineSymbols.cs:47
at System.Linq.Enumerable.Any[String] (IEnumerable`1 source, System.Func`2 predicate) [0x00000] in <filename unknown>:0
at Candlelight.UnityFeatureDefineSymbols+<UnityFeatureDefineSymbols>c__AnonStorey0.<>m__0 (BuildTargetGroup target) [0x00028] in E:\work2\zoo-polis\zoo-polis\Assets\Plugins\Candlelight\Library\Editor\Utilities\UnityFeatureDefineSymbols.cs:46
at Candlelight.UnityFeatureDefineSymbols.SetSymbolForAllBuildTargets (System.String symbol, System.Predicate`1 condition) [0x000b0] in E:\work2\zoo-polis\zoo-polis\Assets\Plugins\Candlelight\Library\Editor\Utilities\UnityFeatureDefineSymbols.cs:146
at Candlelight.UnityFeatureDefineSymbols..cctor () [0x000ea] in E:\work2\zoo-polis\zoo-polis\Assets\Plugins\Candlelight\Library\Editor\Utilities\UnityFeatureDefineSymbols.cs:44
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes()


-----------------------------

ReflectionTypeLoadException: The classes in the module cannot be loaded.
System.Reflection.Assembly.GetTypes () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/Assembly.cs:371)
Candlelight.ReflectionX.get_AllTypes () (at Assets/Plugins/Candlelight/Library/Editor/Utilities/ReflectionX.cs:68)
Candlelight.UnityFeatureDefineSymbols+<UnityFeatureDefineSymbols>c__AnonStorey0.<>m__1 (System.String fullName) (at Assets/Plugins/Candlelight/Library/Editor/Utilities/UnityFeatureDefineSymbols.cs:47)
System.Linq.Enumerable.Any[String] (IEnumerable`1 source, System.Func`2 predicate)
Candlelight.UnityFeatureDefineSymbols+<UnityFeatureDefineSymbols>c__AnonStorey0.<>m__0 (BuildTargetGroup target) (at Assets/Plugins/Candlelight/Library/Editor/Utilities/UnityFeatureDefineSymbols.cs:46)
Candlelight.UnityFeatureDefineSymbols.SetSymbolForAllBuildTargets (System.String symbol, System.Predicate`1 condition) (at Assets/Plugins/Candlelight/Library/Editor/Utilities/UnityFeatureDefineSymbols.cs:146)
Candlelight.UnityFeatureDefineSymbols..cctor () (at Assets/Plugins/Candlelight/Library/Editor/Utilities/UnityFeatureDefineSymbols.cs:44)
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for Candlelight.UnityFeatureDefineSymbols
System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (RuntimeTypeHandle type) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs:101)
UnityEditor.EditorAssemblies.ProcessEditorInitializeOnLoad (System.Type type) (at C:/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:136)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
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/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:262)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:255)
UnityEditor.HostView.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:84)

uncle...@gmail.com

unread,
Dec 15, 2017, 8:58:27 AM12/15/17
to Developer Support
even when open candlelight settings in prefences

Seraphim Whiteless

unread,
Dec 15, 2017, 9:30:03 AM12/15/17
to Developer Support
found solution
Firebase 4.3.0 broke CandleLight plugin

need fix ReflectionX .cs

        public static ReadOnlyCollection<System.Type> AllTypes
        {
            get
            {
                if (s_AllTypes == null)
                {
                    HashSet<System.Type> allTypes = new HashSet<System.Type>();
                    Assembly[] assemblies = System.AppDomain.CurrentDomain.GetAssemblies();
                    for (int i=assemblies.Length-1; i>=0; i--)
                    {
                        Assembly assembly = assemblies[i];
                        try
                        {
                            if (assembly != null)
                            {
                                foreach (System.Type t in assembly.GetTypes())
                                    allTypes.Add(t);
                            }
                        }
                        catch (System.Exception e)
                        {
                            UnityEngine.Debug.Log("(not error) cant add classes from " + assembly.FullName);
                        }
                    }
                    s_AllTypes = new ReadOnlyCollection<System.Type>(allTypes.ToArray());
                }
                return s_AllTypes;
            }
        }

Developer Support

unread,
Dec 17, 2017, 4:58:46 AM12/17/17
to Developer Support
Thanks for the heads up! I actually have this fix on another branch but looks like I never brought it back to mainline and pushed it in an update. I'll make sure it's included at some point
Reply all
Reply to author
Forward
0 new messages