【问题标题】:Cannot setup Firebase to my Unity Project: System.Reflection.ReflectionTypeLoadException无法将 Firebase 设置到我的 Unity 项目:System.Reflection.ReflectionTypeLoadException
【发布时间】:2017-01-21 06:02:36
【问题描述】:

我尝试将 Firebase 实时数据库集成到我的 Unity 项目中。目前我致力于为 Android 构建。我做了所有的步骤: https://firebase.google.com/docs/unity/setup

  • 我将我的应用注册到 Firebase 控制台并获得了 google-services.json
  • 我下载并导入了与 Firebase 数据库相关的包。

但是,我在编辑器中经常遇到一些关于System.Reflection.Assembly.GetTypes ... 的错误(我认为一些与编辑器相关的脚本会出错)。

我为Android SDK (google repository, etc.) 更新了许多软件包。 错误消息实际上发生了变化,但相似。这是我的输出:

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

我哪里错了? 提前致谢。

【问题讨论】:

    标签: android unity3d firebase firebase-realtime-database


    【解决方案1】:

    这是我们的 Firebase SDK 构建中的回归,需要 Unity 5.4 或更高版本(包括 UnityWebRequest 的类型)。

    如果您下载最新的 SDK,您应该不会看到此问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-04-01
      • 2020-11-27
      • 1970-01-01
      • 1970-01-01
      • 2017-09-01
      • 2016-11-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多