In Firebase Option Android Studio when I click on \"connect to firebase\" I am getting the following error.
\"google-services.json\" was found, but it ind
\appname\.idea\modules\app\google-services.json
Delete this file in your project folder first.
In my case, I already had this file in my project files as I changed my package name, and I was trying the add the google-services.json
file for the second time. And I was getting this error: -
> A config file "something\google-services.json" was found, but it
> indicates a project ID that you dont appear to have access to. Request
> access or delete the file in order to proceed with the connection
> process.
For me, I had to navigate to the web console:
https://console.firebase.google.com/u/0/
and add my app as a project manually:
After clicking "ADD FIREBASE" it worked.
For me, the problem was that I had a wrong "google-service.json" file in my project.
(I signed in to Android Studio & Firebase Console)
If you are like me, you need this.
① delete all "google-service" file. You can easily find it by [Ctrl + shift + n] and put the file name in.
② Go to Firebase Console → Setting → App setting → app card below, now you can find "goole-service.json" file that is customized for your project. Download it.
③ Copy the new file and paste it in your Project. (Project → app → here!!!)
④ Go to Firebase assistant and click "connect to Firebase"
In my case my URL of my main activity was different from that of my googleServices.json
file. I will advise you to just copy from your googleServices.json
file and paste in your MainActivity.java
(Make sure both URLs are exactly the same).
Reason:
Solution :
Use same account for Studio and console.
Delete the corrupted JSON and use Studio plugin to create the project, it will automatically handle the corner cases
This error will occur if you are signed in to Android Studio and the Firebase Console with different accounts.
In Android Studio, click on the small profile icon in the upper right corner to see your sign-in account. Do the same for the Firebase Console tab of your browser. If they are different, sign out and sign in to make them the same.