android - 从 Assets/GoogleService-Info.plist 统一生成 Firebase Android 资源文件 google-services.xml 失败

标签 android ios firebase unity3d plist

我想在 Unity 2020.1.14 中设置 Firebase。
我将 GoogleService-Info.plist 下载到我的 Assets 文件夹中,并在 Firebase 控制台中设置了一个项目。
但是,一旦我导入 FirebaseAnalytics 7.0 包,我就会收到此错误:

Generation of the Firebase Android resource file google-services.xml from Assets/GoogleService-Info.plist failed.
If you have not included a valid Firebase Android resources in your app it will fail to initialize.

"python" "/Users/joerg/Projekte/UnityTest/FirebaseTest2012042/Assets/Firebase/Editor/generate_xml_from_google_services_json.py" -i "Assets/GoogleService-Info.plist" -l --plist

Could not find key in plist file: [DATABASE_URL]
如何在 GoogleService-Info.plist 中设置 [DATABASE_URL]?
谢谢
约尔格

最佳答案

这真是令人沮丧。 original setup tutorial 上没有提及关于这个问题。我假设更多的人会遇到这个问题。所以这里是解决方案:

  • 转至 Firebase Console
  • 选择您的项目
  • 转到“实时数据库”
  • 创建实时数据库

  • 创建数据库后。
  • 转到“项目设置”
  • 下载 google-services.jsonGoogleService-Info.plist
  • 在 Unity 项目中替换这些文件。 (这些文件应该在 Assets 文件夹中,或者如果您创建了一个 Data 文件夹,那么您可以在那里找到它们。)

  • 在新生成的文件中有一个 "firebase_url": .以前缺少的。现在应该可以修复此特定错误消息。

    关于android - 从 Assets/GoogleService-Info.plist 统一生成 Firebase Android 资源文件 google-services.xml 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65148274/

    相关文章:

    java - AsyncTask错误Android应用程序崩溃

    android - 如何设计自定义 Android 控件并在 Xml 中使用它?

    android - Android 中 query() 和 rawQuery() 方法的性能差异

    iphone - 如何将特定 View 的方向更改为横向?

    ios - Swift 泛型 - 无法将值转换为类型

    database - Firebase:如何有效跟踪用户/记录更改历史

    Android TextView : is there a way to force the marquee animation with short text?

    ios - UIViewController presentViewController :animated:completion - taking 4 to 6 seconds to launch

    javascript - 为什么我选择的数据只显示最后的数据?

    javascript - 如何将来自不同组件的 firebase auth 和 Cloud Firestore 作为单个 firebase 应用程序使用