fercis
fercis

Reputation: 631

Cannot setup Firebase to my Unity Project: System.Reflection.ReflectionTypeLoadException

I try to integrate Firebase Realtime Database to my Unity project. Currently I work on building for Android. I did all the steps in: https://firebase.google.com/docs/unity/setup

However, I constantly had errors in the editor (I think some editor-related scripts give errors) about some System.Reflection.Assembly.GetTypes ....

I updated many packages for Android SDK (google repository, etc.). The messages of the errors literally changed, but similar. Here is my output:

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 

The class UnityEngine.Networking.UnityWebRequest could not be loaded, used in UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null

Where may I be wrong? Thanks in advance.

Upvotes: 1

Views: 400

Answers (1)

Benjamin Wulfe
Benjamin Wulfe

Reputation: 1735

This was a regression in a build of our Firebase SDK that required Unity 5.4 or later (which included the type for UnityWebRequest).

If you download the latest SDK, you should not see this issue.

Upvotes: 1

Related Questions