Search code examples
firebaseunity-game-enginefirebase-analytics

Unity/Firebase - Project Bundle ID does not match any bundle IDs in your google-services.json files


I'm making a mobile game on Unity, Android first.

And now I'm integrating firebase analytics.

After set info on Firebase Console and put google-services.json file into Unity project, Unity shows an error saying :

Project Bundle ID com.RetroSpirit.ToiletRush does not match any bundle IDs in your google-services.json files
This will result in an app that will fail to initialize.

Available Bundle IDs:


You need to either:
* Fix your app's bundle ID under "Player Settings --> Bundle Identifier"
or:
* Add another app to your firebase project
  Goto https://firebase.google.com/docs/unity/setup#add_firebase_to_your_app_1
  and add the new configuration file to your project.

UnityEngine.Debug:LogError(Object)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:LogErrorIfEnabled(String)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:FindGoogleServicesFile(SortedDictionary`2, String, LogMessage, LogMessage)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:FindGoogleServicesFile(String, LogMessage, LogMessage)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:UpdateJson(Boolean, LogMessage, LogMessage)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:OnPostprocessAllAssets(String[], String[], String[], String[])
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[])
UnityEditorInternal.InternalEditorUtility:ProjectWindowDrag(HierarchyProperty, Boolean)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Here's the part of google-services.json,

 "client": [
    {
      "client_info": {
        "mobilesdk_app_id": "*:***********:android:****************",
        "android_client_info": {
          "package_name": "com.RetroSpirit.ToiletRush"
        }
      },
      "oauth_client": [
        {
          "client_id": "***********-********************************.apps.googleusercontent.com",
          "client_type": 1,
          "android_info": {
            "package_name": "com.RetroSpirit.ToiletRush",
            "certificate_hash": "****************************************"
          }

I don't know what should I check.

Project Bundle ID (the Package name on Build Settings - Other Settings - Identification) is exactly same as package_names in google-services.json.

Any ideas?


Solution

  • Little bit funny to answer myself...

    I found the reason of problem accidently. There was something wrong with my VC runtime so generate_xml_from_google_services_json.exe couldn't extract package name from google-services.json. (vc90.crt.manifest could not be extracted!)

    Unfortunately, I couldn't fix that runtime error despite so many re-install of Visual Studio, VC Runtime and .net frameworks. Finally I re-installed Windows 10 and the problem just gone away... Still don't know what caused this error.