androidfirebaseunity-game-enginegoogle-play-services

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


I am trying to add Firebase to my Unity project but somehow it cannot locate google-services.json

I've tried to use generate_xml_from_google_services_json.exe myself, but that didn't fix the problem. I also tried to edit the generate_xml_from_google_services_json.py python script to change the default location (which is set to a "normal" android app paths) but that didn't work either.

I followed the steps exactly from the Firebase docs and pasted the google-services.json fie in the root of the assets folder, but it still gives me the following error:

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()

Did anyone had this error before(because I couldn't find anyone else with this problem) and how did you fix it?


Solution

  • 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.