Krishna Agarwal
Krishna Agarwal

Reputation: 131

Firebase - Changing file name google-services.json?

Can I change the file name google-services.json to prod-google-services.json?

Upvotes: 0

Views: 2997

Answers (3)

captaindroid
captaindroid

Reputation: 2938

You cannot change the google service file name. You can use flavour to manage the google-services.json file.
Like this:

app/src/
flavor1/google-services.json
flavor2/google-services.json

Look here for detail.

Also, very important to note : You should not delete the google-services.json file from your app folder. Firebase will automatically use google-services.json file from flavor folder if it is present and neglect the google-services.json file from app folder. [Thanks @KrishnaAgarwal]

Upvotes: 1

PRATEEK BHARDWAJ
PRATEEK BHARDWAJ

Reputation: 2432

No you can not change file name . it was detected by android gradle while building project.

Upvotes: 1

AL.
AL.

Reputation: 37798

You should not change the name of the file if you intend to use it. If you're going to use different google-services.json file depending on the app environment, you should Configure Product Flavors.

See Firebase 2.0 - how to deal with multiple flavors (environments) of an android app?

Upvotes: 2

Related Questions