5

I was trying to change google-services.json file of new project from old one. So, I deleted the old one and pasted new json file in two places one by one to test.

  1. app/
  2. app/src

1 case didn't work, so, tried 2 case. But didn't work either. Both cases fetch config from the old project.

So, I deleted app completely in the project. And then tried. Still working!

And then, I deleted all google-services.json files in my laptop. And then tried. BUT STILL WORKING.

How can I solve this problem?

c-an
  • 2,036
  • 1
  • 17
  • 46
  • 2
    https://stackoverflow.com/questions/31597953/what-does-google-services-json-really-do should be cache, try to clean & rebuild – fangzhzh Jul 04 '19 at 02:00

3 Answers3

14

Invalidate cache & Restart Android Studio

OR

Delete app/build Directory from explorer or finder & Rebuild Project

Mayur Sojitra
  • 656
  • 6
  • 15
0

I changed Firebase project (changed google-services.json in app folder). As Mayur Sojitra said,

  • remove app/build folder,

  • rebuild a project,

  • uninstall an application,

  • run the application.

After this new Firebase project properties have been fetched.

CoolMind
  • 16,738
  • 10
  • 131
  • 165
0

The above answers are correct but they are not covering all cases, in my case my Android Project Id was different from the one created inside the firebase project (why? because they have been created by two different persons xD).

SOLUTION: open the google-services.json and change the package_name and bundle_id from the id they are coming with to your application package(can be found in the manifest or build.gradle files)

Mohammad Elsayed
  • 1,275
  • 1
  • 11
  • 30