android - Firebase Unity Android:在您的项目中找不到 google-services.json 文件
问题描述
我正在尝试将 Firebase 添加到我的 Unity 项目中,但不知何故它一直给我一个恼人的错误。
我尝试使用generate_xml_from_google_services_json.exe
自己,但这并没有解决问题。我还尝试编辑generate_xml_from_google_services_json.py
python 脚本以更改默认位置(设置为“正常”android 应用程序路径),但这也不起作用。
我完全按照Firebase 文档中的步骤操作,并将 google-services.json fie 粘贴到文件夹的根目录中,assets
但它仍然给我以下错误:
No google-services.json files found in your project so it is not possible to
generate Firebase Android resources file google-services.xml.
Building without Firebase Android resources (google-services.xml) will result in an app that will fail to initialize.
To resolve this problem, follow the setup instructions at https://firebase.google.com/docs/unity/setup#setup_for_android
UnityEngine.Debug:LogError(Object)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:LogErrorIfEnabled(String)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:FindGoogleServicesFile(ConfigFileType, String, FindGoogleServicesFileMode, LogMessage, LogMessage)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:ReadProjectFields()
Firebase.Editor.SettingsWindow:OnFocus()
UnityEditor.DockArea:OnEnable()
以前有没有人遇到过这个错误(因为我找不到其他人有这个问题),你是如何解决的?
解决方案
获取 Android 应用的配置文件 要下载 Android 应用的配置文件:
登录 Firebase 并打开您的项目。单击设置图标并选择项目设置。在您的应用程序卡中,从列表中选择您需要配置文件的应用程序的包名称。单击 google-services.json。
将 GoogleService-Info.plist 文件添加到项目中。
导航到 Project 窗口中的 Assets 文件夹。将从 Firebase 控制台下载的 GoogleService-Info.plist 拖到文件夹中。注意:GoogleService-Info.plist 可以放在 Assets 文件夹下的任何位置。
推荐阅读
- apache-spark - Spark Streaming Kafka 与 Java11 Scala 代码问题
- c# - Unity 说“无法将浮点数转换为 UnityEngine.Vector3”
- python - Python Openpyxl 单元格创建
- flutter - 如何根据从数据库中获取的值更改文本?
- python - 登录页面错误 - 字典更新序列元素 #0 的长度为 0;2 是必需的
- docker - docker 限制容器之间的通信
- flutter - 如何在与 firebase 集成时解决此问题
- python - re.sub 括号后的正则表达式 \b
- java - xml-apis 依赖项的许可证问题
- jquery - 在循环外添加 jquery 值(创建实时出价)