Firebase Unity Android:在您的项目中找不到 google-services.json 个文件

Firebase Unity Android: No google-services.json files found in your project

我正在尝试将 Firebase 添加到我的 Unity 项目,但不知何故它总是给我一个烦人的错误。

我自己尝试使用 generate_xml_from_google_services_json.exe,但这并没有解决问题。 我还尝试编辑 generate_xml_from_google_services_json.py python 脚本以更改默认位置(设置为 "normal" android 应用程序路径),但这也不起作用。

我完全按照 Firebase docs 中的步骤并将 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()

以前有没有人遇到过这个错误(因为我找不到其他人有这个问题),你是如何解决的?

Download a configuration file

Get a config file for your Android app To download a config file for an Android app:

Sign in to Firebase and open your project. Click the Settings icon and select Project settings. In the Your apps card, select the package name of the app you need a config file for from the list. Click google-services.json.

Add the SDK to your app

Add the GoogleService-Info.plist file to the project.

Navigate to the Assets folder in the Project window. Drag the GoogleService-Info.plist downloaded from the Firebase console into the folder. NOTE: GoogleService-Info.plist can be placed anywhere under the Assets folder.