firebase / firebase/quickstart-unity

The google-services.xml is not updated when switching between two different package names for the same Firebase project

Open
#880 8 comments 0 reactions 1 assignee Claimed by @vimanyu View on GitHub
type: bug unity-editor
Dominant language
C#
Stars
923
Forks
456
PR merge metrics
No merged PRs in 30d

Description

### [REQUIRED] Please fill in the following fields:

* Unity editor version: 2019.2.21f1
* Firebase Unity SDK version: 6.16.1
* Source you installed the SDK: Unity Package Manager
* Problematic Firebase Component: Analytics
* Other Firebase Components in use: Crashlytics
* Additional SDKs you are using: Facebook, IronSrc
* Platform you are using the Unity editor on: Windows
* Platform you are targeting: Android
* Scripting Runtime: IL2CPP

### [REQUIRED] Please describe the issue here:

I have two Android apps (different package names, one for Play Store and one for Amazon Store) configured on the same Firebase project. I have the google-services.json containing both configurations on my Assets folder.

The google-services.xml is only generated when there is a modification on google-services.json and it takes the current package name configured in the Unity Editor to create the google-services.xml.

After that, if I change the package name to build for the other store, it won't regenerate google-services.xml and it will use the wrong config (crashlytics, latest release, etc information still arrives, but they are added to the "wrong bucket/app").

#### Steps to reproduce:

1) Setup your Unity project with package name "com.test.app1"
2) Create two Android apps in the Firebase dashboard: "com.test.app1" and "com.test.app2"
3) Download the google-services.json and add it to the Assets folder
4) It will generate the google-services.xml for "com.test.app1", which is correct
5) Build and test, everything is working fine
6) Now change the Unity project package name to "com.test.app2"
7) Build and test, all firebase data is still going to "com.test.app1"

--> It should have updated google-services.xml with the "com.test.app2" configuration between steps #6 and #7

#### Relevant Code:

N/A

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.