API key not valid firebase auth

Viewed 5756

I've had used a firebase account for my android project, and recently I faced some issues with the account so I decided to create a new one and link my project to this newly made project.

Everything seemed to work fine, but when I tried to use firebase auth, I faced an error which says: API key not valid. Please pass a valid API key.

I searched for hours and all I could find was that I had to redownload google-services.json file and replace it. I did it and I still get the same error

Anyone knows what I have to do? Thanks in advance.

2 Answers

I also faced the same issue and in my scenario API key in json file was expired, just follow the following simple steps

1 - Open firebase console and go to project settings.

2 - In project setting under general tab ou can see Web Api Key. Copy that key.

3- Open Android Studio and open google-service-json which is present in app directory.

4- In json file you can see the API key just changed that key with the one you copied from firebase console and boom you are good to go .

After trying all thing that I found on the web about this problem, the thing that worked for me is Clean Build then Invalidate cash and restart

Related